diff --git a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index 1484fd45cc4d..a10e6e90e79f 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetAnNSPConfigByName() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -53,7 +53,7 @@ public async Task Get_GetAnNSPConfigByName() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListNSPConfigsBySearchService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsListByService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsListByService.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_ListByService" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task GetAll_ListNSPConfigsBySearchService() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAnNSPConfigByName() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -119,7 +119,7 @@ public async Task Exists_GetAnNSPConfigByName() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAnNSPConfigByName() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs index 1ef103f94ba7..ffdff67ac4b5 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAnNSPConfigByName() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsGet.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_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 @@ -50,7 +50,7 @@ public async Task Get_GetAnNSPConfigByName() [Ignore("Only validating compilation of examples")] public async Task Reconcile_ReconcileNSPConfig() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/NetworkSecurityPerimeterConfigurationsReconcile.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/NetworkSecurityPerimeterConfigurationsReconcile.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_Reconcile" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionCollection.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionCollection.cs index b895ee82b831..3d59e63db344 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SearchPrivateEndpointConnectionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PrivateEndpointConnectionUpdate() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/UpdatePrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/UpdatePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -66,7 +66,7 @@ public async Task CreateOrUpdate_PrivateEndpointConnectionUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetPrivateEndpointConnection.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 @@ -100,7 +100,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListPrivateEndpointConnectionsByService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListPrivateEndpointConnectionsByService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/ListPrivateEndpointConnectionsByService.json // this example is just showing the usage of "PrivateEndpointConnections_ListByService" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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,7 +136,7 @@ public async Task GetAll_ListPrivateEndpointConnectionsByService() [Ignore("Only validating compilation of examples")] public async Task Exists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetPrivateEndpointConnection.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 Exists_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetPrivateEndpointConnection.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 diff --git a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionResource.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionResource.cs index 592ae530c478..bf34adbbc4e7 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchPrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SearchPrivateEndpointConnectionResource [Ignore("Only validating compilation of examples")] public async Task Get_PrivateEndpointConnectionGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetPrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetPrivateEndpointConnection.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 @@ -51,7 +51,7 @@ public async Task Get_PrivateEndpointConnectionGet() [Ignore("Only validating compilation of examples")] public async Task Delete_PrivateEndpointConnectionDelete() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/DeletePrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/DeletePrivateEndpointConnection.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 @@ -83,7 +83,7 @@ public async Task Delete_PrivateEndpointConnectionDelete() [Ignore("Only validating compilation of examples")] public async Task Update_PrivateEndpointConnectionUpdate() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/UpdatePrivateEndpointConnection.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/UpdatePrivateEndpointConnection.json // this example is just showing the usage of "PrivateEndpointConnections_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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceCollection.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceCollection.cs index abd123ac4f8d..b5c4afbdb2be 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_SearchServiceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateService.json // this example is just showing the usage of "Services_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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateService() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceAuthOptions() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceAuthOptions.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceAuthOptions.json // this example is just showing the usage of "Services_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 @@ -118,7 +118,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceAuthOptions() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceDisableLocalAuth() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceDisableLocalAuth.json // this example is just showing the usage of "Services_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 @@ -165,7 +165,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceDisableLocalAuth() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPrivateEndpoints.json // this example is just showing the usage of "Services_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 @@ -212,7 +212,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPri [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPs.json // this example is just showing the usage of "Services_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 @@ -268,7 +268,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPub [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json // this example is just showing the usage of "Services_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 @@ -304,7 +304,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPub { Value = "123.4.6.0/18", }}, - Bypass = SearchBypass.AzurePortal, + Bypass = SearchBypass.AzureServices, }, Tags = { @@ -325,7 +325,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceToAllowAccessFromPub [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithCmkEnforcement() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceWithCmkEnforcement.json // this example is just showing the usage of "Services_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 @@ -375,7 +375,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithCmkEnforcement() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithDataExfiltration() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceWithDataExfiltration.json // this example is just showing the usage of "Services_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 @@ -402,7 +402,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithDataExfiltration PartitionCount = 1, HostingMode = SearchServiceHostingMode.Default, ComputeType = SearchServiceComputeType.Default, - DisabledDataExfiltrationOptions = { SearchDisabledDataExfiltrationOption.All }, + DataExfiltrationProtections = { SearchDataExfiltrationProtection.BlockAll }, Tags = { ["app-name"] = "My e-commerce app" @@ -422,7 +422,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithDataExfiltration [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithIdentity() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateServiceWithIdentity.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateServiceWithIdentity.json // this example is just showing the usage of "Services_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 @@ -475,7 +475,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateServiceWithIdentity() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SearchCreateOrUpdateWithSemanticSearch() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateOrUpdateWithSemanticSearch.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateOrUpdateWithSemanticSearch.json // this example is just showing the usage of "Services_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 @@ -522,7 +522,7 @@ public async Task CreateOrUpdate_SearchCreateOrUpdateWithSemanticSearch() [Ignore("Only validating compilation of examples")] public async Task Get_SearchGetService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchGetService.json // this example is just showing the usage of "Services_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 @@ -555,7 +555,7 @@ public async Task Get_SearchGetService() [Ignore("Only validating compilation of examples")] public async Task GetAll_SearchListServicesByResourceGroup() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListServicesByResourceGroup.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchListServicesByResourceGroup.json // this example is just showing the usage of "Services_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 @@ -590,7 +590,7 @@ public async Task GetAll_SearchListServicesByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_SearchGetService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchGetService.json // this example is just showing the usage of "Services_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 @@ -619,7 +619,7 @@ public async Task Exists_SearchGetService() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SearchGetService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchGetService.json // this example is just showing the usage of "Services_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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceResource.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceResource.cs index b2a23e239622..c67f08a6cb6a 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SearchServiceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_SearchServiceResource [Ignore("Only validating compilation of examples")] public async Task Get_SearchGetService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchGetService.json // this example is just showing the usage of "Services_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 @@ -51,7 +51,7 @@ public async Task Get_SearchGetService() [Ignore("Only validating compilation of examples")] public async Task Delete_SearchDeleteService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchDeleteService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchDeleteService.json // this example is just showing the usage of "Services_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 @@ -77,7 +77,7 @@ public async Task Delete_SearchDeleteService() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateService.json // this example is just showing the usage of "Services_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 @@ -116,7 +116,7 @@ public async Task Update_SearchUpdateService() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceAuthOptions() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceAuthOptions.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceAuthOptions.json // this example is just showing the usage of "Services_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,7 +159,7 @@ public async Task Update_SearchUpdateServiceAuthOptions() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceDisableLocalAuth() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceDisableLocalAuth.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceDisableLocalAuth.json // this example is just showing the usage of "Services_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 @@ -199,7 +199,7 @@ public async Task Update_SearchUpdateServiceDisableLocalAuth() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceToAllowAccessFromPrivateEndpoints() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPrivateEndpoints.json // this example is just showing the usage of "Services_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 @@ -235,7 +235,7 @@ public async Task Update_SearchUpdateServiceToAllowAccessFromPrivateEndpoints() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceToAllowAccessFromPublicCustomIPs() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPs.json // this example is just showing the usage of "Services_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 @@ -281,7 +281,7 @@ public async Task Update_SearchUpdateServiceToAllowAccessFromPublicCustomIPs() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndBypass.json // this example is just showing the usage of "Services_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 @@ -312,7 +312,7 @@ public async Task Update_SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndB { Value = "123.4.6.0/18", }}, - Bypass = SearchBypass.AzurePortal, + Bypass = SearchBypass.AzureServices, }, }; SearchServiceResource result = await searchService.UpdateAsync(patch); @@ -328,7 +328,7 @@ public async Task Update_SearchUpdateServiceToAllowAccessFromPublicCustomIPsAndB [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceToRemoveIdentity() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceToRemoveIdentity.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceToRemoveIdentity.json // this example is just showing the usage of "Services_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 @@ -363,7 +363,7 @@ public async Task Update_SearchUpdateServiceToRemoveIdentity() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceWithCmkEnforcement() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithCmkEnforcement.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithCmkEnforcement.json // this example is just showing the usage of "Services_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 @@ -406,7 +406,7 @@ public async Task Update_SearchUpdateServiceWithCmkEnforcement() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceWithDataExfiltration() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithDataExfiltration.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithDataExfiltration.json // this example is just showing the usage of "Services_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 @@ -426,7 +426,7 @@ public async Task Update_SearchUpdateServiceWithDataExfiltration() SearchServicePatch patch = new SearchServicePatch(default) { ReplicaCount = 2, - DisabledDataExfiltrationOptions = { SearchDisabledDataExfiltrationOption.All }, + DataExfiltrationProtections = { SearchDataExfiltrationProtection.BlockAll }, Tags = { ["app-name"] = "My e-commerce app", @@ -446,7 +446,7 @@ public async Task Update_SearchUpdateServiceWithDataExfiltration() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceWithSemanticSearch() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithSemanticSearch.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSemanticSearch.json // this example is just showing the usage of "Services_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 @@ -486,7 +486,7 @@ public async Task Update_SearchUpdateServiceWithSemanticSearch() [Ignore("Only validating compilation of examples")] public async Task Update_SearchUpdateServiceWithSku() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchUpdateServiceWithSku.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchUpdateServiceWithSku.json // this example is just showing the usage of "Services_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 @@ -525,7 +525,7 @@ public async Task Update_SearchUpdateServiceWithSku() [Ignore("Only validating compilation of examples")] public async Task GetAdminKey_SearchGetAdminKeys() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchGetAdminKeys.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchGetAdminKeys.json // this example is just showing the usage of "AdminKeys_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 @@ -551,7 +551,7 @@ public async Task GetAdminKey_SearchGetAdminKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateAdminKey_SearchRegenerateAdminKey() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchRegenerateAdminKey.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchRegenerateAdminKey.json // this example is just showing the usage of "AdminKeys_Regenerate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -578,7 +578,7 @@ public async Task RegenerateAdminKey_SearchRegenerateAdminKey() [Ignore("Only validating compilation of examples")] public async Task CreateQueryKey_SearchCreateQueryKey() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCreateQueryKey.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCreateQueryKey.json // this example is just showing the usage of "QueryKeys_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 @@ -605,7 +605,7 @@ public async Task CreateQueryKey_SearchCreateQueryKey() [Ignore("Only validating compilation of examples")] public async Task GetQueryKeysBySearchService_SearchListQueryKeysBySearchService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListQueryKeysBySearchService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchListQueryKeysBySearchService.json // this example is just showing the usage of "QueryKeys_ListBySearchService" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -634,7 +634,7 @@ public async Task GetQueryKeysBySearchService_SearchListQueryKeysBySearchService [Ignore("Only validating compilation of examples")] public async Task DeleteQueryKey_SearchDeleteQueryKey() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchDeleteQueryKey.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchDeleteQueryKey.json // this example is just showing the usage of "QueryKeys_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 @@ -659,10 +659,10 @@ public async Task DeleteQueryKey_SearchDeleteQueryKey() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetSupportedPrivateLinkResources_ListSupportedPrivateLinkResources() + public async Task Upgrade_UpgradeSearchServiceToLatestVersion() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListSupportedPrivateLinkResources.json - // this example is just showing the usage of "PrivateLinkResources_ListSupported" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/UpgradeSearchServiceToLatestVersion.json + // this example is just showing the usage of "Services_Upgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -677,21 +677,23 @@ public async Task GetSupportedPrivateLinkResources_ListSupportedPrivateLinkResou ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName); SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId); - // invoke the operation and iterate over the result - await foreach (SearchPrivateLinkResource item in searchService.GetSupportedPrivateLinkResourcesAsync()) - { - Console.WriteLine($"Succeeded: {item}"); - } + // invoke the operation + ArmOperation lro = await searchService.UpgradeAsync(WaitUntil.Completed); + SearchServiceResource result = lro.Value; - Console.WriteLine("Succeeded"); + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + SearchServiceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task UpgradeService_UpgradeSearchServiceToLatestVersion() + public async Task GetSupportedPrivateLinkResources_ListSupportedPrivateLinkResources() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/UpgradeSearchServiceToLatestVersion.json - // this example is just showing the usage of "Service_Upgrade" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/ListSupportedPrivateLinkResources.json + // this example is just showing the usage of "PrivateLinkResources_ListSupported" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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(); @@ -706,15 +708,13 @@ public async Task UpgradeService_UpgradeSearchServiceToLatestVersion() ResourceIdentifier searchServiceResourceId = SearchServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, searchServiceName); SearchServiceResource searchService = client.GetSearchServiceResource(searchServiceResourceId); - // invoke the operation - ArmOperation lro = await searchService.UpgradeServiceAsync(WaitUntil.Completed); - SearchServiceResource result = lro.Value; + // invoke the operation and iterate over the result + await foreach (SearchPrivateLinkResource item in searchService.GetSupportedPrivateLinkResourcesAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } - // 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 - SearchServiceData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + Console.WriteLine("Succeeded"); } } } diff --git a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResource.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResource.cs index 6cf46fdad646..e9105b603841 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResource.cs @@ -20,7 +20,7 @@ public partial class Sample_SharedSearchServicePrivateLinkResource [Ignore("Only validating compilation of examples")] public async Task Get_SharedPrivateLinkResourceGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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 @@ -51,7 +51,7 @@ public async Task Get_SharedPrivateLinkResourceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_SharedPrivateLinkResourceDelete() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/DeleteSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/DeleteSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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 @@ -78,7 +78,7 @@ public async Task Delete_SharedPrivateLinkResourceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_SharedPrivateLinkResourceCreateOrUpdate() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/CreateOrUpdateSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResourceCollection.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResourceCollection.cs index 466e3b55ebb7..ceb4da249d98 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResourceCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SharedSearchServicePrivateLinkResourceCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_SharedSearchServicePrivateLinkResourceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_SharedPrivateLinkResourceCreateOrUpdate() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/CreateOrUpdateSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/CreateOrUpdateSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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 @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_SharedPrivateLinkResourceCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_SharedPrivateLinkResourceGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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_SharedPrivateLinkResourceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListSharedPrivateLinkResourcesByService() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/ListSharedPrivateLinkResourcesByService.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/ListSharedPrivateLinkResourcesByService.json // this example is just showing the usage of "SharedPrivateLinkResources_ListByService" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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,7 +135,7 @@ public async Task GetAll_ListSharedPrivateLinkResourcesByService() [Ignore("Only validating compilation of examples")] public async Task Exists_SharedPrivateLinkResourceGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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 @@ -165,7 +165,7 @@ public async Task Exists_SharedPrivateLinkResourceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_SharedPrivateLinkResourceGet() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetSharedPrivateLinkResource.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetSharedPrivateLinkResource.json // this example is just showing the usage of "SharedPrivateLinkResources_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/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index e081d0df1ae0..9b55bd808ee2 100644 --- a/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/search/Azure.ResourceManager.Search/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -21,7 +21,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetSearchServices_SearchListServicesBySubscription() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchListServicesBySubscription.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchListServicesBySubscription.json // this example is just showing the usage of "Services_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 @@ -52,7 +52,7 @@ public async Task GetSearchServices_SearchListServicesBySubscription() [Ignore("Only validating compilation of examples")] public async Task CheckSearchServiceNameAvailability_SearchCheckNameAvailability() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/SearchCheckNameAvailability.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/SearchCheckNameAvailability.json // this example is just showing the usage of "Services_CheckNameAvailability" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 CheckSearchServiceNameAvailability_SearchCheckNameAvailability [Ignore("Only validating compilation of examples")] public async Task GetUsagesBySubscription_GetQuotaUsagesList() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetQuotaUsagesList.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetQuotaUsagesList.json // this example is just showing the usage of "Usages_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 @@ -105,7 +105,7 @@ public async Task GetUsagesBySubscription_GetQuotaUsagesList() [Ignore("Only validating compilation of examples")] public async Task UsageBySubscriptionSku_GetQuotaUsage() { - // Generated from example definition: specification/search/resource-manager/Microsoft.Search/preview/2025-02-01-preview/examples/GetQuotaUsage.json + // Generated from example definition: specification/search/resource-manager/Microsoft.Search/stable/2025-05-01/examples/GetQuotaUsage.json // this example is just showing the usage of "UsageBySubscriptionSku" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/search/Azure.ResourceManager.Search/src/Generated/ArmSearchModelFactory.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/ArmSearchModelFactory.cs index 589df24c18cd..b74e730f8fc4 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/ArmSearchModelFactory.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/ArmSearchModelFactory.cs @@ -16,58 +16,6 @@ namespace Azure.ResourceManager.Search.Models /// Model factory for models. public static partial class ArmSearchModelFactory { - /// Initializes a new instance of . - /// The name of the region. - /// The list of features offered in this region. - /// The list of SKUs offered in this region. - /// A new instance for mocking. - public static SearchServiceOfferingsByRegion SearchServiceOfferingsByRegion(string regionName = null, IEnumerable features = null, IEnumerable skus = null) - { - features ??= new List(); - skus ??= new List(); - - return new SearchServiceOfferingsByRegion(regionName, features?.ToList(), skus?.ToList(), serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The name of the feature offered in this region. - /// A new instance for mocking. - public static SearchServiceFeatureOffering SearchServiceFeatureOffering(SearchServiceFeatureName? name = null) - { - return new SearchServiceFeatureOffering(name, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Defines the SKU of a search service, which determines billing rate and capacity limits. - /// The limits associated with this SKU offered in this region. - /// A new instance for mocking. - public static SearchServiceSkuOffering SearchServiceSkuOffering(SearchServiceSkuName? skuName = null, SearchServiceSkuOfferingLimits limits = null) - { - return new SearchServiceSkuOffering(skuName != null ? new SearchSku(skuName, serializedAdditionalRawData: null) : null, limits, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The maximum number of indexes available for this SKU. - /// The maximum number of indexers available for this SKU. - /// The maximum storage size in Gigabytes available for this SKU per partition. - /// The maximum vector storage size in Gigabytes available for this SKU per partition. - /// The maximum number of search units available for this SKU. - /// The maximum number of replicas available for this SKU. - /// The maximum number of partitions available for this SKU. - /// A new instance for mocking. - public static SearchServiceSkuOfferingLimits SearchServiceSkuOfferingLimits(int? indexes = null, int? indexers = null, float? partitionStorageInGigabytes = null, float? partitionVectorStorageInGigabytes = null, int? searchUnits = null, int? replicas = null, int? partitions = null) - { - return new SearchServiceSkuOfferingLimits( - indexes, - indexers, - partitionStorageInGigabytes, - partitionVectorStorageInGigabytes, - searchUnits, - replicas, - partitions, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The primary admin API key of the search service. /// The secondary admin API key of the search service. @@ -99,13 +47,13 @@ public static SearchServiceQueryKey SearchServiceQueryKey(string name = null, st /// The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. /// The endpoint of the Azure AI Search service. /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. /// The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. /// The details of the search service status. /// The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'Succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up. /// Network specific rules that determine how the Azure AI Search service may be reached. - /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. + /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. /// When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. /// Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. @@ -113,13 +61,13 @@ public static SearchServiceQueryKey SearchServiceQueryKey(string name = null, st /// The list of private endpoint connections to the Azure AI Search service. /// The list of shared private link resources managed by the Azure AI Search service. /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. - /// Indicates whether or not the search service has an upgrade available. - /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. + /// Indicates if the search service has an upgrade available. + /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. /// A new instance for mocking. - public static SearchServiceData SearchServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SearchServiceSkuName? searchSkuName = null, ManagedServiceIdentity identity = null, int? replicaCount = null, int? partitionCount = null, Uri endpoint = null, SearchServiceHostingMode? hostingMode = null, SearchServiceComputeType? computeType = null, SearchServicePublicInternetAccess? publicInternetAccess = null, SearchServiceStatus? status = null, string statusDetails = null, SearchServiceProvisioningState? provisioningState = null, SearchServiceNetworkRuleSet networkRuleSet = null, IEnumerable disabledDataExfiltrationOptions = null, SearchEncryptionWithCmk encryptionWithCmk = null, bool? isLocalAuthDisabled = null, SearchAadAuthDataPlaneAuthOptions authOptions = null, SearchSemanticSearch? semanticSearch = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, ETag? eTag = null, bool? isUpgradeAvailable = null, DateTimeOffset? serviceUpgradeOn = null) + public static SearchServiceData SearchServiceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SearchServiceSkuName? searchSkuName = null, ManagedServiceIdentity identity = null, int? replicaCount = null, int? partitionCount = null, Uri endpoint = null, SearchServiceHostingMode? hostingMode = null, SearchServiceComputeType? computeType = null, SearchServicePublicInternetAccess? publicInternetAccess = null, SearchServiceStatus? status = null, string statusDetails = null, SearchServiceProvisioningState? provisioningState = null, SearchServiceNetworkRuleSet networkRuleSet = null, IEnumerable dataExfiltrationProtections = null, SearchEncryptionWithCmk encryptionWithCmk = null, bool? isLocalAuthDisabled = null, SearchAadAuthDataPlaneAuthOptions authOptions = null, SearchSemanticSearch? semanticSearch = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, ETag? eTag = null, UpgradeAvailable? isUpgradeAvailable = null, DateTimeOffset? serviceUpgradedOn = null) { tags ??= new Dictionary(); - disabledDataExfiltrationOptions ??= new List(); + dataExfiltrationProtections ??= new List(); privateEndpointConnections ??= new List(); sharedPrivateLinkResources ??= new List(); @@ -142,7 +90,7 @@ public static SearchServiceData SearchServiceData(ResourceIdentifier id = null, statusDetails, provisioningState, networkRuleSet, - disabledDataExfiltrationOptions?.ToList(), + dataExfiltrationProtections?.ToList(), encryptionWithCmk, isLocalAuthDisabled, authOptions, @@ -151,7 +99,7 @@ public static SearchServiceData SearchServiceData(ResourceIdentifier id = null, sharedPrivateLinkResources?.ToList(), eTag, isUpgradeAvailable, - serviceUpgradeOn, + serviceUpgradedOn, serializedAdditionalRawData: null); } @@ -213,13 +161,13 @@ public static SharedSearchServicePrivateLinkResourceData SharedSearchServicePriv /// The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. /// The endpoint of the Azure AI Search service. /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. /// The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. /// The details of the search service status. /// The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'Succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up. /// Network specific rules that determine how the Azure AI Search service may be reached. - /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. + /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. /// When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. /// Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. @@ -227,13 +175,13 @@ public static SharedSearchServicePrivateLinkResourceData SharedSearchServicePriv /// The list of private endpoint connections to the Azure AI Search service. /// The list of shared private link resources managed by the Azure AI Search service. /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. - /// Indicates whether or not the search service has an upgrade available. - /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. + /// Indicates if the search service has an upgrade available. + /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. /// A new instance for mocking. - public static SearchServicePatch SearchServicePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SearchServiceSkuName? searchSkuName = null, ManagedServiceIdentity identity = null, int? replicaCount = null, int? partitionCount = null, Uri endpoint = null, SearchServiceHostingMode? hostingMode = null, SearchServiceComputeType? computeType = null, SearchServicePublicInternetAccess? publicInternetAccess = null, SearchServiceStatus? status = null, string statusDetails = null, SearchServiceProvisioningState? provisioningState = null, SearchServiceNetworkRuleSet networkRuleSet = null, IEnumerable disabledDataExfiltrationOptions = null, SearchEncryptionWithCmk encryptionWithCmk = null, bool? isLocalAuthDisabled = null, SearchAadAuthDataPlaneAuthOptions authOptions = null, SearchSemanticSearch? semanticSearch = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, ETag? eTag = null, bool? isUpgradeAvailable = null, DateTimeOffset? serviceUpgradeOn = null) + public static SearchServicePatch SearchServicePatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SearchServiceSkuName? searchSkuName = null, ManagedServiceIdentity identity = null, int? replicaCount = null, int? partitionCount = null, Uri endpoint = null, SearchServiceHostingMode? hostingMode = null, SearchServiceComputeType? computeType = null, SearchServicePublicInternetAccess? publicInternetAccess = null, SearchServiceStatus? status = null, string statusDetails = null, SearchServiceProvisioningState? provisioningState = null, SearchServiceNetworkRuleSet networkRuleSet = null, IEnumerable dataExfiltrationProtections = null, SearchEncryptionWithCmk encryptionWithCmk = null, bool? isLocalAuthDisabled = null, SearchAadAuthDataPlaneAuthOptions authOptions = null, SearchSemanticSearch? semanticSearch = null, IEnumerable privateEndpointConnections = null, IEnumerable sharedPrivateLinkResources = null, ETag? eTag = null, UpgradeAvailable? isUpgradeAvailable = null, DateTimeOffset? serviceUpgradedOn = null) { tags ??= new Dictionary(); - disabledDataExfiltrationOptions ??= new List(); + dataExfiltrationProtections ??= new List(); privateEndpointConnections ??= new List(); sharedPrivateLinkResources ??= new List(); @@ -256,7 +204,7 @@ public static SearchServicePatch SearchServicePatch(ResourceIdentifier id = null statusDetails, provisioningState, networkRuleSet, - disabledDataExfiltrationOptions?.ToList(), + dataExfiltrationProtections?.ToList(), encryptionWithCmk, isLocalAuthDisabled, authOptions, @@ -265,7 +213,7 @@ public static SearchServicePatch SearchServicePatch(ResourceIdentifier id = null sharedPrivateLinkResources?.ToList(), eTag, isUpgradeAvailable, - serviceUpgradeOn, + serviceUpgradedOn, serializedAdditionalRawData: null); } @@ -372,26 +320,66 @@ public static QuotaUsageResultName QuotaUsageResultName(string value = null, str /// The name. /// The resourceType. /// The systemData. - /// - /// The perimeter for a network security perimeter configuration. - /// The resource association for the network security perimeter. - /// The profile for a network security perimeter configuration. - /// + /// Network security configuration properties. /// A new instance for mocking. - public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string provisioningState = null, NspConfigPerimeter networkSecurityPerimeter = null, NspConfigAssociation resourceAssociation = null, NspConfigProfile profile = null, IEnumerable provisioningIssues = null) + public static NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NetworkSecurityPerimeterConfigurationProperties properties = null) { - provisioningIssues ??= new List(); - return new NetworkSecurityPerimeterConfigurationData( id, name, resourceType, systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Provisioning state of a network security perimeter configuration that is being created or updated. + /// List of provisioning issues, if any. + /// Information about a network security perimeter (NSP). + /// Information about resource association. + /// Network security perimeter configuration profile. + /// A new instance for mocking. + public static NetworkSecurityPerimeterConfigurationProperties NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = null, IEnumerable provisioningIssues = null, NetworkSecurityPerimeter networkSecurityPerimeter = null, ResourceAssociation resourceAssociation = null, NetworkSecurityProfile profile = null) + { + provisioningIssues ??= new List(); + + return new NetworkSecurityPerimeterConfigurationProperties( provisioningState, + provisioningIssues?.ToList(), networkSecurityPerimeter, resourceAssociation, profile, - provisioningIssues?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the issue. + /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + /// A new instance for mocking. + public static ProvisioningIssue ProvisioningIssue(string name = null, ProvisioningIssueProperties properties = null) + { + return new ProvisioningIssue(name, properties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Type of issue. + /// Severity of the issue. + /// Description of the issue. + /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. + /// Access rules that can be added to the network security profile (NSP) to remediate the issue. + /// A new instance for mocking. + public static ProvisioningIssueProperties ProvisioningIssueProperties(IssueType? issueType = null, Severity? severity = null, string description = null, IEnumerable suggestedResourceIds = null, IEnumerable suggestedAccessRules = null) + { + suggestedResourceIds ??= new List(); + suggestedAccessRules ??= new List(); + + return new ProvisioningIssueProperties( + issueType, + severity, + description, + suggestedResourceIds?.ToList(), + suggestedAccessRules?.ToList(), serializedAdditionalRawData: null); } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchResourceGroupResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchResourceGroupResource.cs index 4d94d1a7a51d..fdb38050cd5b 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchResourceGroupResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchResourceGroupResource.cs @@ -54,7 +54,7 @@ public virtual SearchServiceCollection GetSearchServices() /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -86,7 +86,7 @@ public virtual async Task> GetSearchServiceAsync /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchSubscriptionResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchSubscriptionResource.cs index cf985e713fee..eacd98c6bd96 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchSubscriptionResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchSubscriptionResource.cs @@ -63,7 +63,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -94,7 +94,7 @@ public virtual AsyncPageable GetSearchServicesAsync(Searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -125,7 +125,7 @@ public virtual Pageable GetSearchServices(SearchManagemen /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -168,7 +168,7 @@ public virtual async Task> CheckSe /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual Response CheckSearchServiceN /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -239,7 +239,7 @@ public virtual AsyncPageable GetUsagesBySubscriptionAsync(Azur /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -267,7 +267,7 @@ public virtual Pageable GetUsagesBySubscription(AzureLocation /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -308,7 +308,7 @@ public virtual async Task> UsageBySubscriptionSkuAsyn /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchTenantResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchTenantResource.cs deleted file mode 100644 index c1c3e6a8d15c..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/MockableSearchTenantResource.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Threading; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Search.Models; - -namespace Azure.ResourceManager.Search.Mocking -{ - /// A class to add extension methods to TenantResource. - public partial class MockableSearchTenantResource : ArmResource - { - private ClientDiagnostics _offeringsClientDiagnostics; - private OfferingsRestOperations _offeringsRestClient; - - /// Initializes a new instance of the class for mocking. - protected MockableSearchTenantResource() - { - } - - /// 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 MockableSearchTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - } - - private ClientDiagnostics OfferingsClientDiagnostics => _offeringsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.Search", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private OfferingsRestOperations OfferingsRestClient => _offeringsRestClient ??= new OfferingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - - private string GetApiVersionOrNull(ResourceType resourceType) - { - TryGetApiVersion(resourceType, out string apiVersion); - return apiVersion; - } - - /// - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// - /// - /// Request Path - /// /providers/Microsoft.Search/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2025-02-01-preview - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetOfferingsAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SearchServiceOfferingsByRegion.DeserializeSearchServiceOfferingsByRegion(e), OfferingsClientDiagnostics, Pipeline, "MockableSearchTenantResource.GetOfferings", "value", null, cancellationToken); - } - - /// - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// - /// - /// Request Path - /// /providers/Microsoft.Search/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2025-02-01-preview - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetOfferings(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => OfferingsRestClient.CreateListRequest(); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SearchServiceOfferingsByRegion.DeserializeSearchServiceOfferingsByRegion(e), OfferingsClientDiagnostics, Pipeline, "MockableSearchTenantResource.GetOfferings", "value", null, cancellationToken); - } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs index cd83cb293597..ed62f8fdc077 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Extensions/SearchExtensions.cs @@ -33,11 +33,6 @@ private static MockableSearchSubscriptionResource GetMockableSearchSubscriptionR return resource.GetCachedClient(client => new MockableSearchSubscriptionResource(client, resource.Id)); } - private static MockableSearchTenantResource GetMockableSearchTenantResource(ArmResource resource) - { - return resource.GetCachedClient(client => new MockableSearchTenantResource(client, resource.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. @@ -144,7 +139,7 @@ public static SearchServiceCollection GetSearchServices(this ResourceGroupResour /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -183,7 +178,7 @@ public static async Task> GetSearchServiceAsync( /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -222,7 +217,7 @@ public static Response GetSearchService(this ResourceGrou /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -259,7 +254,7 @@ public static AsyncPageable GetSearchServicesAsync(this S /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -296,7 +291,7 @@ public static Pageable GetSearchServices(this Subscriptio /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -333,7 +328,7 @@ public static async Task> CheckSea /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -370,7 +365,7 @@ public static Response CheckSearchServiceNa /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -404,7 +399,7 @@ public static AsyncPageable GetUsagesBySubscriptionAsync(this /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -438,7 +433,7 @@ public static Pageable GetUsagesBySubscription(this Subscripti /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -473,7 +468,7 @@ public static async Task> UsageBySubscriptionSkuAsync /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -494,69 +489,5 @@ public static Response UsageBySubscriptionSku(this Subscriptio return GetMockableSearchSubscriptionResource(subscriptionResource).UsageBySubscriptionSku(location, skuName, searchManagementRequestOptions, cancellationToken); } - - /// - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// - /// - /// Request Path - /// /providers/Microsoft.Search/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2025-02-01-preview - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetOfferingsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tenantResource, nameof(tenantResource)); - - return GetMockableSearchTenantResource(tenantResource).GetOfferingsAsync(cancellationToken); - } - - /// - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// - /// - /// Request Path - /// /providers/Microsoft.Search/offerings - /// - /// - /// Operation Id - /// Offerings_List - /// - /// - /// Default Api Version - /// 2025-02-01-preview - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetOfferings(this TenantResource tenantResource, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tenantResource, nameof(tenantResource)); - - return GetMockableSearchTenantResource(tenantResource).GetOfferings(cancellationToken); - } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.Serialization.cs similarity index 74% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.Serialization.cs index 57a699898abc..e89910d50a90 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspConfigAccessRule : IUtf8JsonSerializable, IJsonModel + public partial class AccessRule : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspConfigAccessRule)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{format}' format."); } if (Optional.IsDefined(Name)) @@ -62,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspConfigAccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AccessRule 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(NspConfigAccessRule)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigAccessRule(document.RootElement, options); + return DeserializeAccessRule(document.RootElement, options); } - internal static NspConfigAccessRule DeserializeNspConfigAccessRule(JsonElement element, ModelReaderWriterOptions options = null) + internal static AccessRule DeserializeAccessRule(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static NspConfigAccessRule DeserializeNspConfigAccessRule(JsonElement e return null; } string name = default; - NspConfigAccessRuleProperties properties = default; + AccessRuleProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -99,7 +99,7 @@ internal static NspConfigAccessRule DeserializeNspConfigAccessRule(JsonElement e { continue; } - properties = NspConfigAccessRuleProperties.DeserializeNspConfigAccessRuleProperties(property.Value, options); + properties = AccessRuleProperties.DeserializeAccessRuleProperties(property.Value, options); continue; } if (options.Format != "W") @@ -108,7 +108,7 @@ internal static NspConfigAccessRule DeserializeNspConfigAccessRule(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new NspConfigAccessRule(name, properties, serializedAdditionalRawData); + return new AccessRule(name, properties, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -164,9 +164,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -175,26 +175,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspConfigAccessRule)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{options.Format}' format."); } } - NspConfigAccessRule IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AccessRule 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigAccessRule(document.RootElement, options); + return DeserializeAccessRule(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspConfigAccessRule)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessRule)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.cs similarity index 68% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.cs index 8789b252939c..f42ecf93af31 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRule.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRule.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.Search.Models { - /// An access rule for a network security perimeter configuration. - public partial class NspConfigAccessRule + /// Access rule in a network security perimeter configuration profile. + public partial class AccessRule { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class NspConfigAccessRule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspConfigAccessRule() + /// Initializes a new instance of . + public AccessRule() { } - /// Initializes a new instance of . - /// - /// The properties for the access rules in a network security perimeter configuration. + /// Initializes a new instance of . + /// Name of the access rule. + /// Properties of Access Rule. /// Keeps track of any properties unknown to the library. - internal NspConfigAccessRule(string name, NspConfigAccessRuleProperties properties, IDictionary serializedAdditionalRawData) + internal AccessRule(string name, AccessRuleProperties properties, IDictionary serializedAdditionalRawData) { Name = name; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the name. + /// Name of the access rule. [WirePath("name")] public string Name { get; set; } - /// The properties for the access rules in a network security perimeter configuration. + /// Properties of Access Rule. [WirePath("properties")] - public NspConfigAccessRuleProperties Properties { get; set; } + public AccessRuleProperties Properties { get; set; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleDirection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleDirection.cs new file mode 100644 index 000000000000..d3f696d47e31 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleDirection.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.Search.Models +{ + /// Direction of Access Rule. + public readonly partial struct AccessRuleDirection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AccessRuleDirection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InboundValue = "Inbound"; + private const string OutboundValue = "Outbound"; + + /// Applies to inbound network traffic to the secured resources. + public static AccessRuleDirection Inbound { get; } = new AccessRuleDirection(InboundValue); + /// Applies to outbound network traffic from the secured resources. + public static AccessRuleDirection Outbound { get; } = new AccessRuleDirection(OutboundValue); + /// Determines if two values are the same. + public static bool operator ==(AccessRuleDirection left, AccessRuleDirection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AccessRuleDirection left, AccessRuleDirection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AccessRuleDirection(string value) => new AccessRuleDirection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AccessRuleDirection other && Equals(other); + /// + public bool Equals(AccessRuleDirection 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/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.Serialization.cs similarity index 66% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.Serialization.cs index 8c52af177db9..dd8068b15c2e 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.Serialization.cs @@ -12,14 +12,15 @@ using System.Text; using System.Text.Json; using Azure.Core; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Search.Models { - public partial class NspConfigAccessRuleProperties : IUtf8JsonSerializable, IJsonModel + public partial class AccessRuleProperties : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,16 +31,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspConfigAccessRuleProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{format}' format."); } if (Optional.IsDefined(Direction)) { writer.WritePropertyName("direction"u8); - writer.WriteStringValue(Direction); + writer.WriteStringValue(Direction.Value.ToString()); } if (Optional.IsCollectionDefined(AddressPrefixes)) { @@ -51,6 +52,26 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsCollectionDefined(Subscriptions)) + { + writer.WritePropertyName("subscriptions"u8); + writer.WriteStartArray(); + foreach (var item in Subscriptions) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) + { + writer.WritePropertyName("networkSecurityPerimeters"u8); + writer.WriteStartArray(); + foreach (var item in NetworkSecurityPerimeters) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (Optional.IsCollectionDefined(FullyQualifiedDomainNames)) { writer.WritePropertyName("fullyQualifiedDomainNames"u8); @@ -61,23 +82,23 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(Subscriptions)) + if (Optional.IsCollectionDefined(EmailAddresses)) { - writer.WritePropertyName("subscriptions"u8); + writer.WritePropertyName("emailAddresses"u8); writer.WriteStartArray(); - foreach (var item in Subscriptions) + foreach (var item in EmailAddresses) { writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) + if (Optional.IsCollectionDefined(PhoneNumbers)) { - writer.WritePropertyName("networkSecurityPerimeters"u8); + writer.WritePropertyName("phoneNumbers"u8); writer.WriteStartArray(); - foreach (var item in NetworkSecurityPerimeters) + foreach (var item in PhoneNumbers) { - writer.WriteObjectValue(item, options); + writer.WriteStringValue(item); } writer.WriteEndArray(); } @@ -98,19 +119,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspConfigAccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + AccessRuleProperties 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(NspConfigAccessRuleProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigAccessRuleProperties(document.RootElement, options); + return DeserializeAccessRuleProperties(document.RootElement, options); } - internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static AccessRuleProperties DeserializeAccessRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -118,18 +139,24 @@ internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProp { return null; } - string direction = default; + AccessRuleDirection? direction = default; IList addressPrefixes = default; + IList subscriptions = default; + IList networkSecurityPerimeters = default; IList fullyQualifiedDomainNames = default; - IList subscriptions = default; - IList networkSecurityPerimeters = default; + IList emailAddresses = default; + IList phoneNumbers = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("direction"u8)) { - direction = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + direction = new AccessRuleDirection(property.Value.GetString()); continue; } if (property.NameEquals("addressPrefixes"u8)) @@ -146,6 +173,34 @@ internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProp addressPrefixes = array; continue; } + if (property.NameEquals("subscriptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + subscriptions = array; + continue; + } + if (property.NameEquals("networkSecurityPerimeters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(item, options)); + } + networkSecurityPerimeters = array; + continue; + } if (property.NameEquals("fullyQualifiedDomainNames"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -160,7 +215,7 @@ internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProp fullyQualifiedDomainNames = array; continue; } - if (property.NameEquals("subscriptions"u8)) + if (property.NameEquals("emailAddresses"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { @@ -171,21 +226,21 @@ internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProp { array.Add(item.GetString()); } - subscriptions = array; + emailAddresses = array; continue; } - if (property.NameEquals("networkSecurityPerimeters"u8)) + if (property.NameEquals("phoneNumbers"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NspConfigNetworkSecurityPerimeterRule.DeserializeNspConfigNetworkSecurityPerimeterRule(item, options)); + array.Add(item.GetString()); } - networkSecurityPerimeters = array; + phoneNumbers = array; continue; } if (options.Format != "W") @@ -194,12 +249,14 @@ internal static NspConfigAccessRuleProperties DeserializeNspConfigAccessRuleProp } } serializedAdditionalRawData = rawDataDictionary; - return new NspConfigAccessRuleProperties( + return new AccessRuleProperties( direction, addressPrefixes ?? new ChangeTrackingList(), + subscriptions ?? new ChangeTrackingList(), + networkSecurityPerimeters ?? new ChangeTrackingList(), fullyQualifiedDomainNames ?? new ChangeTrackingList(), - subscriptions ?? new ChangeTrackingList(), - networkSecurityPerimeters ?? new ChangeTrackingList(), + emailAddresses ?? new ChangeTrackingList(), + phoneNumbers ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -225,15 +282,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(Direction)) { builder.Append(" direction: "); - if (Direction.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Direction}'''"); - } - else - { - builder.AppendLine($"'{Direction}'"); - } + builder.AppendLine($"'{Direction.Value.ToString()}'"); } } @@ -273,6 +322,52 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Subscriptions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subscriptions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Subscriptions)) + { + if (Subscriptions.Any()) + { + builder.Append(" subscriptions: "); + builder.AppendLine("["); + foreach (var item in Subscriptions) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " subscriptions: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeters), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkSecurityPerimeters: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) + { + if (NetworkSecurityPerimeters.Any()) + { + builder.Append(" networkSecurityPerimeters: "); + builder.AppendLine("["); + foreach (var item in NetworkSecurityPerimeters) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkSecurityPerimeters: "); + } + builder.AppendLine(" ]"); + } + } + } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FullyQualifiedDomainNames), out propertyOverride); if (hasPropertyOverride) { @@ -309,21 +404,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Subscriptions), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EmailAddresses), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" subscriptions: "); + builder.Append(" emailAddresses: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(Subscriptions)) + if (Optional.IsCollectionDefined(EmailAddresses)) { - if (Subscriptions.Any()) + if (EmailAddresses.Any()) { - builder.Append(" subscriptions: "); + builder.Append(" emailAddresses: "); builder.AppendLine("["); - foreach (var item in Subscriptions) + foreach (var item in EmailAddresses) { if (item == null) { @@ -345,23 +440,36 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeters), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PhoneNumbers), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" networkSecurityPerimeters: "); + builder.Append(" phoneNumbers: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(NetworkSecurityPerimeters)) + if (Optional.IsCollectionDefined(PhoneNumbers)) { - if (NetworkSecurityPerimeters.Any()) + if (PhoneNumbers.Any()) { - builder.Append(" networkSecurityPerimeters: "); + builder.Append(" phoneNumbers: "); builder.AppendLine("["); - foreach (var item in NetworkSecurityPerimeters) + foreach (var item in PhoneNumbers) { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkSecurityPerimeters: "); + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } } builder.AppendLine(" ]"); } @@ -372,9 +480,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -383,26 +491,26 @@ BinaryData IPersistableModel.Write(ModelReaderWri case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspConfigAccessRuleProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{options.Format}' format."); } } - NspConfigAccessRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + AccessRuleProperties 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigAccessRuleProperties(document.RootElement, options); + return DeserializeAccessRuleProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspConfigAccessRuleProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.cs similarity index 50% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.cs index 87685a19a462..35b58d487ac1 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAccessRuleProperties.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/AccessRuleProperties.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.ResourceManager.Resources.Models; namespace Azure.ResourceManager.Search.Models { - /// The properties for the access rules in a network security perimeter configuration. - public partial class NspConfigAccessRuleProperties + /// Properties of Access Rule. + public partial class AccessRuleProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,46 +46,58 @@ public partial class NspConfigAccessRuleProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspConfigAccessRuleProperties() + /// Initializes a new instance of . + public AccessRuleProperties() { AddressPrefixes = new ChangeTrackingList(); + Subscriptions = new ChangeTrackingList(); + NetworkSecurityPerimeters = new ChangeTrackingList(); FullyQualifiedDomainNames = new ChangeTrackingList(); - Subscriptions = new ChangeTrackingList(); - NetworkSecurityPerimeters = new ChangeTrackingList(); + EmailAddresses = new ChangeTrackingList(); + PhoneNumbers = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// - /// - /// - /// - /// + /// Initializes a new instance of . + /// Direction of Access Rule. + /// Address prefixes in the CIDR format for inbound rules. + /// Subscriptions for inbound rules. + /// Network security perimeters for inbound rules. + /// Fully qualified domain names (FQDN) for outbound rules. + /// Email addresses for outbound rules. + /// Phone numbers for outbound rules. /// Keeps track of any properties unknown to the library. - internal NspConfigAccessRuleProperties(string direction, IList addressPrefixes, IList fullyQualifiedDomainNames, IList subscriptions, IList networkSecurityPerimeters, IDictionary serializedAdditionalRawData) + internal AccessRuleProperties(AccessRuleDirection? direction, IList addressPrefixes, IList subscriptions, IList networkSecurityPerimeters, IList fullyQualifiedDomainNames, IList emailAddresses, IList phoneNumbers, IDictionary serializedAdditionalRawData) { Direction = direction; AddressPrefixes = addressPrefixes; - FullyQualifiedDomainNames = fullyQualifiedDomainNames; Subscriptions = subscriptions; NetworkSecurityPerimeters = networkSecurityPerimeters; + FullyQualifiedDomainNames = fullyQualifiedDomainNames; + EmailAddresses = emailAddresses; + PhoneNumbers = phoneNumbers; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the direction. + /// Direction of Access Rule. [WirePath("direction")] - public string Direction { get; set; } - /// Gets the address prefixes. + public AccessRuleDirection? Direction { get; set; } + /// Address prefixes in the CIDR format for inbound rules. [WirePath("addressPrefixes")] public IList AddressPrefixes { get; } - /// Gets the fully qualified domain names. - [WirePath("fullyQualifiedDomainNames")] - public IList FullyQualifiedDomainNames { get; } - /// Gets the subscriptions. + /// Subscriptions for inbound rules. [WirePath("subscriptions")] - public IList Subscriptions { get; } - /// Gets the network security perimeters. + public IList Subscriptions { get; } + /// Network security perimeters for inbound rules. [WirePath("networkSecurityPerimeters")] - public IList NetworkSecurityPerimeters { get; } + public IList NetworkSecurityPerimeters { get; } + /// Fully qualified domain names (FQDN) for outbound rules. + [WirePath("fullyQualifiedDomainNames")] + public IList FullyQualifiedDomainNames { get; } + /// Email addresses for outbound rules. + [WirePath("emailAddresses")] + public IList EmailAddresses { get; } + /// Phone numbers for outbound rules. + [WirePath("phoneNumbers")] + public IList PhoneNumbers { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/IssueType.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/IssueType.cs new file mode 100644 index 000000000000..cd8366a9e109 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/IssueType.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.Search.Models +{ + /// Type of issue. + public readonly partial struct IssueType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IssueType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ConfigurationPropagationFailureValue = "ConfigurationPropagationFailure"; + private const string MissingPerimeterConfigurationValue = "MissingPerimeterConfiguration"; + private const string MissingIdentityConfigurationValue = "MissingIdentityConfiguration"; + + /// Unknown issue type. + public static IssueType Unknown { get; } = new IssueType(UnknownValue); + /// An error occurred while applying the network security perimeter (NSP) configuration. + public static IssueType ConfigurationPropagationFailure { get; } = new IssueType(ConfigurationPropagationFailureValue); + /// A network connectivity issue is happening on the resource which could be addressed either by adding new resources to the network security perimeter (NSP) or by modifying access rules. + public static IssueType MissingPerimeterConfiguration { get; } = new IssueType(MissingPerimeterConfigurationValue); + /// An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to perform outbound access as a member of the NSP. + public static IssueType MissingIdentityConfiguration { get; } = new IssueType(MissingIdentityConfigurationValue); + /// Determines if two values are the same. + public static bool operator ==(IssueType left, IssueType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IssueType left, IssueType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IssueType(string value) => new IssueType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IssueType other && Equals(other); + /// + public bool Equals(IssueType 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/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs similarity index 70% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs index ed5c1ddc899c..bd28be9bc714 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspConfigPerimeter : IUtf8JsonSerializable, IJsonModel + public partial class NetworkSecurityPerimeter : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspConfigPerimeter)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); } if (Optional.IsDefined(Id)) @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(PerimeterGuid)) { writer.WritePropertyName("perimeterGuid"u8); - writer.WriteStringValue(PerimeterGuid); + writer.WriteStringValue(PerimeterGuid.Value); } if (Optional.IsDefined(Location)) { @@ -67,19 +67,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspConfigPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkSecurityPerimeter 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(NspConfigPerimeter)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigPerimeter(document.RootElement, options); + return DeserializeNetworkSecurityPerimeter(document.RootElement, options); } - internal static NspConfigPerimeter DeserializeNspConfigPerimeter(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -87,8 +87,8 @@ internal static NspConfigPerimeter DeserializeNspConfigPerimeter(JsonElement ele { return null; } - string id = default; - string perimeterGuid = default; + ResourceIdentifier id = default; + Guid? perimeterGuid = default; AzureLocation? location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -96,12 +96,20 @@ internal static NspConfigPerimeter DeserializeNspConfigPerimeter(JsonElement ele { if (property.NameEquals("id"u8)) { - id = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("perimeterGuid"u8)) { - perimeterGuid = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + perimeterGuid = property.Value.GetGuid(); continue; } if (property.NameEquals("location"u8)) @@ -119,7 +127,7 @@ internal static NspConfigPerimeter DeserializeNspConfigPerimeter(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new NspConfigPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); + return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -144,15 +152,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(Id)) { builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } + builder.AppendLine($"'{Id.ToString()}'"); } } @@ -167,15 +167,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(PerimeterGuid)) { builder.Append(" perimeterGuid: "); - if (PerimeterGuid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{PerimeterGuid}'''"); - } - else - { - builder.AppendLine($"'{PerimeterGuid}'"); - } + builder.AppendLine($"'{PerimeterGuid.Value.ToString()}'"); } } @@ -198,9 +190,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -209,26 +201,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspConfigPerimeter)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); } } - NspConfigPerimeter IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkSecurityPerimeter 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigPerimeter(document.RootElement, options); + return DeserializeNetworkSecurityPerimeter(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspConfigPerimeter)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.cs similarity index 67% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.cs index 46d3a5173eda..688b76406519 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeter.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.Search.Models { - /// The network security perimeter properties present in a configuration rule. - public partial class NspConfigNetworkSecurityPerimeterRule + /// Information about a network security perimeter (NSP). + public partial class NetworkSecurityPerimeter { /// /// Keeps track of any properties unknown to the library. @@ -46,17 +46,17 @@ public partial class NspConfigNetworkSecurityPerimeterRule /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspConfigNetworkSecurityPerimeterRule() + /// Initializes a new instance of . + public NetworkSecurityPerimeter() { } - /// Initializes a new instance of . - /// - /// - /// + /// Initializes a new instance of . + /// Fully qualified Azure resource ID of the NSP resource. + /// Universal unique ID (UUID) of the network security perimeter. + /// Location of the network security perimeter. /// Keeps track of any properties unknown to the library. - internal NspConfigNetworkSecurityPerimeterRule(string id, string perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) + internal NetworkSecurityPerimeter(ResourceIdentifier id, Guid? perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) { Id = id; PerimeterGuid = perimeterGuid; @@ -64,13 +64,13 @@ internal NspConfigNetworkSecurityPerimeterRule(string id, string perimeterGuid, _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the id. + /// Fully qualified Azure resource ID of the NSP resource. [WirePath("id")] - public string Id { get; set; } - /// Gets or sets the perimeter guid. + public ResourceIdentifier Id { get; set; } + /// Universal unique ID (UUID) of the network security perimeter. [WirePath("perimeterGuid")] - public string PerimeterGuid { get; set; } - /// Gets or sets the location. + public Guid? PerimeterGuid { get; set; } + /// Location of the network security perimeter. [WirePath("location")] public AzureLocation? Location { get; set; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs index dec8cc71aadb..bb23d2338b19 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs @@ -36,7 +36,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); writer.WriteStartArray(); @@ -46,10 +46,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -89,7 +89,7 @@ internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetwo return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,7 +110,11 @@ internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetwo } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -167,15 +171,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(NextLink)) { builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } + builder.AppendLine($"'{NextLink.AbsoluteUri}'"); } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs index 95eea809f89e..f97a0c39662a 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Search.Models { - /// A list of network security perimeter configurations for a server. + /// Result of a list NSP (network security perimeter) configurations request. internal partial class NetworkSecurityPerimeterConfigurationListResult { /// @@ -52,19 +52,19 @@ internal NetworkSecurityPerimeterConfigurationListResult() } /// Initializes a new instance of . - /// Array of results. - /// Link to retrieve next page of results. + /// Array of network security perimeter results. + /// The link used to get the next page of results. /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NetworkSecurityPerimeterConfigurationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Array of results. + /// Array of network security perimeter results. public IReadOnlyList Value { get; } - /// Link to retrieve next page of results. - public string NextLink { get; } + /// The link used to get the next page of results. + public Uri NextLink { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..35229806d9fa --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs @@ -0,0 +1,311 @@ +// 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.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Search.Models +{ + public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProvisioningIssues)) + { + writer.WritePropertyName("provisioningIssues"u8); + writer.WriteStartArray(); + foreach (var item in ProvisioningIssues) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(NetworkSecurityPerimeter)) + { + writer.WritePropertyName("networkSecurityPerimeter"u8); + writer.WriteObjectValue(NetworkSecurityPerimeter, options); + } + if (Optional.IsDefined(ResourceAssociation)) + { + writer.WritePropertyName("resourceAssociation"u8); + writer.WriteObjectValue(ResourceAssociation, options); + } + if (Optional.IsDefined(Profile)) + { + writer.WritePropertyName("profile"u8); + writer.WriteObjectValue(Profile, 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, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + NetworkSecurityPerimeterConfigurationProperties 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(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); + } + + internal static NetworkSecurityPerimeterConfigurationProperties DeserializeNetworkSecurityPerimeterConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState = default; + IReadOnlyList provisioningIssues = default; + NetworkSecurityPerimeter networkSecurityPerimeter = default; + ResourceAssociation resourceAssociation = default; + NetworkSecurityProfile profile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NetworkSecurityPerimeterConfigurationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningIssues"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProvisioningIssue.DeserializeProvisioningIssue(item, options)); + } + provisioningIssues = array; + continue; + } + if (property.NameEquals("networkSecurityPerimeter"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkSecurityPerimeter = NetworkSecurityPerimeter.DeserializeNetworkSecurityPerimeter(property.Value, options); + continue; + } + if (property.NameEquals("resourceAssociation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceAssociation = ResourceAssociation.DeserializeResourceAssociation(property.Value, options); + continue; + } + if (property.NameEquals("profile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + profile = NetworkSecurityProfile.DeserializeNetworkSecurityProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkSecurityPerimeterConfigurationProperties( + provisioningState, + provisioningIssues ?? new ChangeTrackingList(), + networkSecurityPerimeter, + resourceAssociation, + profile, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningIssues: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProvisioningIssues)) + { + if (ProvisioningIssues.Any()) + { + builder.Append(" provisioningIssues: "); + builder.AppendLine("["); + foreach (var item in ProvisioningIssues) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " provisioningIssues: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkSecurityPerimeter: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NetworkSecurityPerimeter)) + { + builder.Append(" networkSecurityPerimeter: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 2, false, " networkSecurityPerimeter: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceAssociation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceAssociation)) + { + builder.Append(" resourceAssociation: "); + BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 2, false, " resourceAssociation: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" profile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Profile)) + { + builder.Append(" profile: "); + BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 2, false, " profile: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + 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); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + NetworkSecurityPerimeterConfigurationProperties 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, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkSecurityPerimeterConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.cs new file mode 100644 index 000000000000..0cbc03d89940 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.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.Search.Models +{ + /// Network security configuration properties. + public partial class NetworkSecurityPerimeterConfigurationProperties + { + /// + /// 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 NetworkSecurityPerimeterConfigurationProperties() + { + ProvisioningIssues = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Provisioning state of a network security perimeter configuration that is being created or updated. + /// List of provisioning issues, if any. + /// Information about a network security perimeter (NSP). + /// Information about resource association. + /// Network security perimeter configuration profile. + /// Keeps track of any properties unknown to the library. + internal NetworkSecurityPerimeterConfigurationProperties(NetworkSecurityPerimeterConfigurationProvisioningState? provisioningState, IReadOnlyList provisioningIssues, NetworkSecurityPerimeter networkSecurityPerimeter, ResourceAssociation resourceAssociation, NetworkSecurityProfile profile, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ProvisioningIssues = provisioningIssues; + NetworkSecurityPerimeter = networkSecurityPerimeter; + ResourceAssociation = resourceAssociation; + Profile = profile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Provisioning state of a network security perimeter configuration that is being created or updated. + [WirePath("provisioningState")] + public NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get; } + /// List of provisioning issues, if any. + [WirePath("provisioningIssues")] + public IReadOnlyList ProvisioningIssues { get; } + /// Information about a network security perimeter (NSP). + [WirePath("networkSecurityPerimeter")] + public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; set; } + /// Information about resource association. + [WirePath("resourceAssociation")] + public ResourceAssociation ResourceAssociation { get; set; } + /// Network security perimeter configuration profile. + [WirePath("profile")] + public NetworkSecurityProfile Profile { get; set; } + } +} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.cs new file mode 100644 index 000000000000..c5df17a6bd88 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityPerimeterConfigurationProvisioningState.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.Search.Models +{ + /// Provisioning state of a network security perimeter configuration that is being created or updated. + public readonly partial struct NetworkSecurityPerimeterConfigurationProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NetworkSecurityPerimeterConfigurationProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string CreatingValue = "Creating"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Succeeded. + public static NetworkSecurityPerimeterConfigurationProvisioningState Succeeded { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(SucceededValue); + /// Creating. + public static NetworkSecurityPerimeterConfigurationProvisioningState Creating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CreatingValue); + /// Updating. + public static NetworkSecurityPerimeterConfigurationProvisioningState Updating { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(UpdatingValue); + /// Deleting. + public static NetworkSecurityPerimeterConfigurationProvisioningState Deleting { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(DeletingValue); + /// Accepted. + public static NetworkSecurityPerimeterConfigurationProvisioningState Accepted { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(AcceptedValue); + /// Failed. + public static NetworkSecurityPerimeterConfigurationProvisioningState Failed { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(FailedValue); + /// Canceled. + public static NetworkSecurityPerimeterConfigurationProvisioningState Canceled { get; } = new NetworkSecurityPerimeterConfigurationProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NetworkSecurityPerimeterConfigurationProvisioningState left, NetworkSecurityPerimeterConfigurationProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NetworkSecurityPerimeterConfigurationProvisioningState(string value) => new NetworkSecurityPerimeterConfigurationProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NetworkSecurityPerimeterConfigurationProvisioningState other && Equals(other); + /// + public bool Equals(NetworkSecurityPerimeterConfigurationProvisioningState 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/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.Serialization.cs similarity index 54% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.Serialization.cs index 6b6c85e383b7..8d284518a33f 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspConfigProfile : IUtf8JsonSerializable, IJsonModel + public partial class NetworkSecurityProfile : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +30,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspConfigProfile)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{format}' format."); } if (Optional.IsDefined(Name)) @@ -44,7 +44,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(AccessRulesVersion)) { writer.WritePropertyName("accessRulesVersion"u8); - writer.WriteStringValue(AccessRulesVersion); + writer.WriteNumberValue(AccessRulesVersion.Value); } if (Optional.IsCollectionDefined(AccessRules)) { @@ -56,6 +56,21 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndArray(); } + if (Optional.IsDefined(DiagnosticSettingsVersion)) + { + writer.WritePropertyName("diagnosticSettingsVersion"u8); + writer.WriteNumberValue(DiagnosticSettingsVersion.Value); + } + if (Optional.IsCollectionDefined(EnabledLogCategories)) + { + writer.WritePropertyName("enabledLogCategories"u8); + writer.WriteStartArray(); + foreach (var item in EnabledLogCategories) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -73,19 +88,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspConfigProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkSecurityProfile 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(NspConfigProfile)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigProfile(document.RootElement, options); + return DeserializeNetworkSecurityProfile(document.RootElement, options); } - internal static NspConfigProfile DeserializeNspConfigProfile(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkSecurityProfile DeserializeNetworkSecurityProfile(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -94,8 +109,10 @@ internal static NspConfigProfile DeserializeNspConfigProfile(JsonElement element return null; } string name = default; - string accessRulesVersion = default; - IList accessRules = default; + int? accessRulesVersion = default; + IList accessRules = default; + int? diagnosticSettingsVersion = default; + IList enabledLogCategories = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -107,7 +124,11 @@ internal static NspConfigProfile DeserializeNspConfigProfile(JsonElement element } if (property.NameEquals("accessRulesVersion"u8)) { - accessRulesVersion = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessRulesVersion = property.Value.GetInt32(); continue; } if (property.NameEquals("accessRules"u8)) @@ -116,21 +137,50 @@ internal static NspConfigProfile DeserializeNspConfigProfile(JsonElement element { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(NspConfigAccessRule.DeserializeNspConfigAccessRule(item, options)); + array.Add(AccessRule.DeserializeAccessRule(item, options)); } accessRules = array; continue; } + if (property.NameEquals("diagnosticSettingsVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diagnosticSettingsVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("enabledLogCategories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + enabledLogCategories = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new NspConfigProfile(name, accessRulesVersion, accessRules ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new NetworkSecurityProfile( + name, + accessRulesVersion, + accessRules ?? new ChangeTrackingList(), + diagnosticSettingsVersion, + enabledLogCategories ?? new ChangeTrackingList(), + serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -178,15 +228,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(AccessRulesVersion)) { builder.Append(" accessRulesVersion: "); - if (AccessRulesVersion.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccessRulesVersion}'''"); - } - else - { - builder.AppendLine($"'{AccessRulesVersion}'"); - } + builder.AppendLine($"{AccessRulesVersion.Value}"); } } @@ -213,13 +255,64 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiagnosticSettingsVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diagnosticSettingsVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DiagnosticSettingsVersion)) + { + builder.Append(" diagnosticSettingsVersion: "); + builder.AppendLine($"{DiagnosticSettingsVersion.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnabledLogCategories), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabledLogCategories: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(EnabledLogCategories)) + { + if (EnabledLogCategories.Any()) + { + builder.Append(" enabledLogCategories: "); + builder.AppendLine("["); + foreach (var item in EnabledLogCategories) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } - 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) { @@ -228,26 +321,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions op case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspConfigProfile)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{options.Format}' format."); } } - NspConfigProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkSecurityProfile 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigProfile(document.RootElement, options); + return DeserializeNetworkSecurityProfile(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspConfigProfile)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.cs similarity index 55% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.cs index a41a764daf36..a97b4a6964ab 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigProfile.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NetworkSecurityProfile.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.Search.Models { - /// The profile for a network security perimeter configuration. - public partial class NspConfigProfile + /// Network security perimeter configuration profile. + public partial class NetworkSecurityProfile { /// /// Keeps track of any properties unknown to the library. @@ -45,33 +45,44 @@ public partial class NspConfigProfile /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspConfigProfile() + /// Initializes a new instance of . + public NetworkSecurityProfile() { - AccessRules = new ChangeTrackingList(); + AccessRules = new ChangeTrackingList(); + EnabledLogCategories = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// - /// - /// + /// Initializes a new instance of . + /// Name of the profile. + /// Current access rules version. + /// List of Access Rules. + /// Current diagnostic settings version. + /// List of log categories that are enabled. /// Keeps track of any properties unknown to the library. - internal NspConfigProfile(string name, string accessRulesVersion, IList accessRules, IDictionary serializedAdditionalRawData) + internal NetworkSecurityProfile(string name, int? accessRulesVersion, IList accessRules, int? diagnosticSettingsVersion, IList enabledLogCategories, IDictionary serializedAdditionalRawData) { Name = name; AccessRulesVersion = accessRulesVersion; AccessRules = accessRules; + DiagnosticSettingsVersion = diagnosticSettingsVersion; + EnabledLogCategories = enabledLogCategories; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the name. + /// Name of the profile. [WirePath("name")] public string Name { get; set; } - /// Gets or sets the access rules version. + /// Current access rules version. [WirePath("accessRulesVersion")] - public string AccessRulesVersion { get; set; } - /// Gets the access rules. + public int? AccessRulesVersion { get; set; } + /// List of Access Rules. [WirePath("accessRules")] - public IList AccessRules { get; } + public IList AccessRules { get; } + /// Current diagnostic settings version. + [WirePath("diagnosticSettingsVersion")] + public int? DiagnosticSettingsVersion { get; set; } + /// List of log categories that are enabled. + [WirePath("enabledLogCategories")] + public IList EnabledLogCategories { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.Serialization.cs deleted file mode 100644 index 8dde974a7faa..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigNetworkSecurityPerimeterRule.Serialization.cs +++ /dev/null @@ -1,234 +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; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - public partial class NspConfigNetworkSecurityPerimeterRule : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(NspConfigNetworkSecurityPerimeterRule)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(PerimeterGuid)) - { - writer.WritePropertyName("perimeterGuid"u8); - writer.WriteStringValue(PerimeterGuid); - } - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - NspConfigNetworkSecurityPerimeterRule 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(NspConfigNetworkSecurityPerimeterRule)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigNetworkSecurityPerimeterRule(document.RootElement, options); - } - - internal static NspConfigNetworkSecurityPerimeterRule DeserializeNspConfigNetworkSecurityPerimeterRule(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string id = default; - string perimeterGuid = default; - AzureLocation? location = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = property.Value.GetString(); - continue; - } - if (property.NameEquals("perimeterGuid"u8)) - { - perimeterGuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new NspConfigNetworkSecurityPerimeterRule(id, perimeterGuid, location, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - if (Id.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Id}'''"); - } - else - { - builder.AppendLine($"'{Id}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" perimeterGuid: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PerimeterGuid)) - { - builder.Append(" perimeterGuid: "); - if (PerimeterGuid.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{PerimeterGuid}'''"); - } - else - { - builder.AppendLine($"'{PerimeterGuid}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Location)) - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(NspConfigNetworkSecurityPerimeterRule)} does not support writing '{options.Format}' format."); - } - } - - NspConfigNetworkSecurityPerimeterRule 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigNetworkSecurityPerimeterRule(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(NspConfigNetworkSecurityPerimeterRule)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.cs deleted file mode 100644 index dfaa8456b908..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigPerimeter.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; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - /// The perimeter for a network security perimeter configuration. - public partial class NspConfigPerimeter - { - /// - /// 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 NspConfigPerimeter() - { - } - - /// Initializes a new instance of . - /// - /// - /// - /// Keeps track of any properties unknown to the library. - internal NspConfigPerimeter(string id, string perimeterGuid, AzureLocation? location, IDictionary serializedAdditionalRawData) - { - Id = id; - PerimeterGuid = perimeterGuid; - Location = location; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets or sets the id. - [WirePath("id")] - public string Id { get; set; } - /// Gets or sets the perimeter guid. - [WirePath("perimeterGuid")] - public string PerimeterGuid { get; set; } - /// Gets or sets the location. - [WirePath("location")] - public AzureLocation? Location { get; set; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.cs deleted file mode 100644 index 0651a3b3263e..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.cs +++ /dev/null @@ -1,88 +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.Search.Models -{ - /// The properties to describe any issues with provisioning network security perimeters to a search service. - public partial class NspProvisioningIssueProperties - { - /// - /// 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 NspProvisioningIssueProperties() - { - SuggestedResourceIds = new ChangeTrackingList(); - SuggestedAccessRules = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// - /// - /// - /// - /// - /// Keeps track of any properties unknown to the library. - internal NspProvisioningIssueProperties(string issueType, string severity, string description, IList suggestedResourceIds, IList suggestedAccessRules, IDictionary serializedAdditionalRawData) - { - IssueType = issueType; - Severity = severity; - Description = description; - SuggestedResourceIds = suggestedResourceIds; - SuggestedAccessRules = suggestedAccessRules; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Gets or sets the issue type. - [WirePath("issueType")] - public string IssueType { get; set; } - /// Gets or sets the severity. - [WirePath("severity")] - public string Severity { get; set; } - /// Gets or sets the description. - [WirePath("description")] - public string Description { get; set; } - /// Gets the suggested resource ids. - [WirePath("suggestedResourceIds")] - public IList SuggestedResourceIds { get; } - /// Gets the suggested access rules. - [WirePath("suggestedAccessRules")] - public IList SuggestedAccessRules { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.Serialization.cs deleted file mode 100644 index 67df0075d123..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.Serialization.cs +++ /dev/null @@ -1,219 +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.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - internal partial class OfferingsListResult : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(OfferingsListResult)} does not support writing '{format}' format."); - } - - 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" && Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - 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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - OfferingsListResult 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(OfferingsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeOfferingsListResult(document.RootElement, options); - } - - internal static OfferingsListResult DeserializeOfferingsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SearchServiceOfferingsByRegion.DeserializeSearchServiceOfferingsByRegion(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new OfferingsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(OfferingsListResult)} does not support writing '{options.Format}' format."); - } - } - - OfferingsListResult 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeOfferingsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(OfferingsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.cs deleted file mode 100644 index 95dbfe7ae467..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/OfferingsListResult.cs +++ /dev/null @@ -1,70 +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.Search.Models -{ - /// The response containing a list of features and SKUs offered in various regions. - internal partial class OfferingsListResult - { - /// - /// 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 OfferingsListResult() - { - Value = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The list of regions with their respective features and SKUs offered. - /// The URL to get the next set of offerings, if any. - /// Keeps track of any properties unknown to the library. - internal OfferingsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) - { - Value = value; - NextLink = nextLink; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The list of regions with their respective features and SKUs offered. - public IReadOnlyList Value { get; } - /// The URL to get the next set of offerings, if any. - public string NextLink { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.Serialization.cs similarity index 73% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.Serialization.cs index bf19425134f6..b66edc7e8efd 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspProvisioningIssue : IUtf8JsonSerializable, IJsonModel + public partial class ProvisioningIssue : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,18 +29,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspProvisioningIssue)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Name)) + if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); } - if (Optional.IsDefined(Properties)) + if (options.Format != "W" && Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); @@ -62,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ProvisioningIssue 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(NspProvisioningIssue)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspProvisioningIssue(document.RootElement, options); + return DeserializeProvisioningIssue(document.RootElement, options); } - internal static NspProvisioningIssue DeserializeNspProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) + internal static ProvisioningIssue DeserializeProvisioningIssue(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static NspProvisioningIssue DeserializeNspProvisioningIssue(JsonElement return null; } string name = default; - NspProvisioningIssueProperties properties = default; + ProvisioningIssueProperties properties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -99,7 +99,7 @@ internal static NspProvisioningIssue DeserializeNspProvisioningIssue(JsonElement { continue; } - properties = NspProvisioningIssueProperties.DeserializeNspProvisioningIssueProperties(property.Value, options); + properties = ProvisioningIssueProperties.DeserializeProvisioningIssueProperties(property.Value, options); continue; } if (options.Format != "W") @@ -108,7 +108,7 @@ internal static NspProvisioningIssue DeserializeNspProvisioningIssue(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new NspProvisioningIssue(name, properties, serializedAdditionalRawData); + return new ProvisioningIssue(name, properties, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -164,9 +164,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -175,26 +175,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspProvisioningIssue)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{options.Format}' format."); } } - NspProvisioningIssue IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ProvisioningIssue 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspProvisioningIssue(document.RootElement, options); + return DeserializeProvisioningIssue(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspProvisioningIssue)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.cs similarity index 57% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.cs index 0fcf21ecac6a..9f059ff4bb52 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssue.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssue.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.Search.Models { - /// An object to describe any issues with provisioning network security perimeters to a search service. - public partial class NspProvisioningIssue + /// Describes a provisioning issue for a network security perimeter configuration. + public partial class ProvisioningIssue { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class NspProvisioningIssue /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspProvisioningIssue() + /// Initializes a new instance of . + internal ProvisioningIssue() { } - /// Initializes a new instance of . - /// - /// The properties to describe any issues with provisioning network security perimeters to a search service. + /// Initializes a new instance of . + /// Name of the issue. + /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. /// Keeps track of any properties unknown to the library. - internal NspProvisioningIssue(string name, NspProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) + internal ProvisioningIssue(string name, ProvisioningIssueProperties properties, IDictionary serializedAdditionalRawData) { Name = name; Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the name. + /// Name of the issue. [WirePath("name")] - public string Name { get; set; } - /// The properties to describe any issues with provisioning network security perimeters to a search service. + public string Name { get; } + /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. [WirePath("properties")] - public NspProvisioningIssueProperties Properties { get; set; } + public ProvisioningIssueProperties Properties { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs similarity index 68% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs index b4611888f98a..f79c5a249dc7 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspProvisioningIssueProperties.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspProvisioningIssueProperties : IUtf8JsonSerializable, IJsonModel + public partial class ProvisioningIssueProperties : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,44 +30,49 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspProvisioningIssueProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); } - if (Optional.IsDefined(IssueType)) + if (options.Format != "W" && Optional.IsDefined(IssueType)) { writer.WritePropertyName("issueType"u8); - writer.WriteStringValue(IssueType); + writer.WriteStringValue(IssueType.Value.ToString()); } - if (Optional.IsDefined(Severity)) + if (options.Format != "W" && Optional.IsDefined(Severity)) { writer.WritePropertyName("severity"u8); - writer.WriteStringValue(Severity); + writer.WriteStringValue(Severity.Value.ToString()); } - if (Optional.IsDefined(Description)) + if (options.Format != "W" && Optional.IsDefined(Description)) { writer.WritePropertyName("description"u8); writer.WriteStringValue(Description); } - if (Optional.IsCollectionDefined(SuggestedResourceIds)) + if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedResourceIds)) { writer.WritePropertyName("suggestedResourceIds"u8); writer.WriteStartArray(); foreach (var item in SuggestedResourceIds) { + if (item == null) + { + writer.WriteNullValue(); + continue; + } writer.WriteStringValue(item); } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(SuggestedAccessRules)) + if (options.Format != "W" && Optional.IsCollectionDefined(SuggestedAccessRules)) { writer.WritePropertyName("suggestedAccessRules"u8); writer.WriteStartArray(); foreach (var item in SuggestedAccessRules) { - writer.WriteStringValue(item); + writer.WriteObjectValue(item, options); } writer.WriteEndArray(); } @@ -88,19 +93,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ProvisioningIssueProperties 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(NspProvisioningIssueProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspProvisioningIssueProperties(document.RootElement, options); + return DeserializeProvisioningIssueProperties(document.RootElement, options); } - internal static NspProvisioningIssueProperties DeserializeNspProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ProvisioningIssueProperties DeserializeProvisioningIssueProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -108,23 +113,31 @@ internal static NspProvisioningIssueProperties DeserializeNspProvisioningIssuePr { return null; } - string issueType = default; - string severity = default; + IssueType? issueType = default; + Severity? severity = default; string description = default; - IList suggestedResourceIds = default; - IList suggestedAccessRules = default; + IReadOnlyList suggestedResourceIds = default; + IReadOnlyList suggestedAccessRules = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("issueType"u8)) { - issueType = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + issueType = new IssueType(property.Value.GetString()); continue; } if (property.NameEquals("severity"u8)) { - severity = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + severity = new Severity(property.Value.GetString()); continue; } if (property.NameEquals("description"u8)) @@ -138,10 +151,17 @@ internal static NspProvisioningIssueProperties DeserializeNspProvisioningIssuePr { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + if (item.ValueKind == JsonValueKind.Null) + { + array.Add(null); + } + else + { + array.Add(new ResourceIdentifier(item.GetString())); + } } suggestedResourceIds = array; continue; @@ -152,10 +172,10 @@ internal static NspProvisioningIssueProperties DeserializeNspProvisioningIssuePr { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(item.GetString()); + array.Add(AccessRule.DeserializeAccessRule(item, options)); } suggestedAccessRules = array; continue; @@ -166,12 +186,12 @@ internal static NspProvisioningIssueProperties DeserializeNspProvisioningIssuePr } } serializedAdditionalRawData = rawDataDictionary; - return new NspProvisioningIssueProperties( + return new ProvisioningIssueProperties( issueType, severity, description, - suggestedResourceIds ?? new ChangeTrackingList(), - suggestedAccessRules ?? new ChangeTrackingList(), + suggestedResourceIds ?? new ChangeTrackingList(), + suggestedAccessRules ?? new ChangeTrackingList(), serializedAdditionalRawData); } @@ -197,15 +217,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(IssueType)) { builder.Append(" issueType: "); - if (IssueType.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{IssueType}'''"); - } - else - { - builder.AppendLine($"'{IssueType}'"); - } + builder.AppendLine($"'{IssueType.Value.ToString()}'"); } } @@ -220,15 +232,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(Severity)) { builder.Append(" severity: "); - if (Severity.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Severity}'''"); - } - else - { - builder.AppendLine($"'{Severity}'"); - } + builder.AppendLine($"'{Severity.Value.ToString()}'"); } } @@ -276,15 +280,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.Append("null"); continue; } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } + builder.AppendLine($" '{item.ToString()}'"); } builder.AppendLine(" ]"); } @@ -307,20 +303,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("["); foreach (var item in SuggestedAccessRules) { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " suggestedAccessRules: "); } builder.AppendLine(" ]"); } @@ -331,9 +314,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -342,26 +325,26 @@ BinaryData IPersistableModel.Write(ModelReaderWr case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspProvisioningIssueProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{options.Format}' format."); } } - NspProvisioningIssueProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ProvisioningIssueProperties 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspProvisioningIssueProperties(document.RootElement, options); + return DeserializeProvisioningIssueProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspProvisioningIssueProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.cs new file mode 100644 index 000000000000..02f9fd6490c3 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ProvisioningIssueProperties.cs @@ -0,0 +1,89 @@ +// 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.Search.Models +{ + /// Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should generate separate provisioning issue elements for each separate issue detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + public partial class ProvisioningIssueProperties + { + /// + /// 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 ProvisioningIssueProperties() + { + SuggestedResourceIds = new ChangeTrackingList(); + SuggestedAccessRules = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Type of issue. + /// Severity of the issue. + /// Description of the issue. + /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. + /// Access rules that can be added to the network security profile (NSP) to remediate the issue. + /// Keeps track of any properties unknown to the library. + internal ProvisioningIssueProperties(IssueType? issueType, Severity? severity, string description, IReadOnlyList suggestedResourceIds, IReadOnlyList suggestedAccessRules, IDictionary serializedAdditionalRawData) + { + IssueType = issueType; + Severity = severity; + Description = description; + SuggestedResourceIds = suggestedResourceIds; + SuggestedAccessRules = suggestedAccessRules; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Type of issue. + [WirePath("issueType")] + public IssueType? IssueType { get; } + /// Severity of the issue. + [WirePath("severity")] + public Severity? Severity { get; } + /// Description of the issue. + [WirePath("description")] + public string Description { get; } + /// Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter (NSP) to remediate the issue. + [WirePath("suggestedResourceIds")] + public IReadOnlyList SuggestedResourceIds { get; } + /// Access rules that can be added to the network security profile (NSP) to remediate the issue. + [WirePath("suggestedAccessRules")] + public IReadOnlyList SuggestedAccessRules { get; } + } +} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.Serialization.cs similarity index 71% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.Serialization.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.Serialization.cs index 98ec7d828860..92eef67a2081 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Search.Models { - public partial class NspConfigAssociation : IUtf8JsonSerializable, IJsonModel + public partial class ResourceAssociation : 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) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,10 +29,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(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(NspConfigAssociation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); } if (Optional.IsDefined(Name)) @@ -43,7 +43,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(AccessMode)) { writer.WritePropertyName("accessMode"u8); - writer.WriteStringValue(AccessMode); + writer.WriteStringValue(AccessMode.Value.ToString()); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -62,19 +62,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - NspConfigAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ResourceAssociation 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(NspConfigAssociation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeNspConfigAssociation(document.RootElement, options); + return DeserializeResourceAssociation(document.RootElement, options); } - internal static NspConfigAssociation DeserializeNspConfigAssociation(JsonElement element, ModelReaderWriterOptions options = null) + internal static ResourceAssociation DeserializeResourceAssociation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -83,7 +83,7 @@ internal static NspConfigAssociation DeserializeNspConfigAssociation(JsonElement return null; } string name = default; - string accessMode = default; + ResourceAssociationAccessMode? accessMode = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -95,7 +95,11 @@ internal static NspConfigAssociation DeserializeNspConfigAssociation(JsonElement } if (property.NameEquals("accessMode"u8)) { - accessMode = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + accessMode = new ResourceAssociationAccessMode(property.Value.GetString()); continue; } if (options.Format != "W") @@ -104,7 +108,7 @@ internal static NspConfigAssociation DeserializeNspConfigAssociation(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new NspConfigAssociation(name, accessMode, serializedAdditionalRawData); + return new ResourceAssociation(name, accessMode, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -152,15 +156,7 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(AccessMode)) { builder.Append(" accessMode: "); - if (AccessMode.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{AccessMode}'''"); - } - else - { - builder.AppendLine($"'{AccessMode}'"); - } + builder.AppendLine($"'{AccessMode.Value.ToString()}'"); } } @@ -168,9 +164,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - 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) { @@ -179,26 +175,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(NspConfigAssociation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{options.Format}' format."); } } - NspConfigAssociation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ResourceAssociation 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeNspConfigAssociation(document.RootElement, options); + return DeserializeResourceAssociation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(NspConfigAssociation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ResourceAssociation)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.cs similarity index 69% rename from sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.cs rename to sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.cs index 1421196bbeb0..2c2315039453 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/NspConfigAssociation.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociation.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.Search.Models { - /// The resource association for the network security perimeter. - public partial class NspConfigAssociation + /// Information about resource association. + public partial class ResourceAssociation { /// /// Keeps track of any properties unknown to the library. @@ -45,27 +45,27 @@ public partial class NspConfigAssociation /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public NspConfigAssociation() + /// Initializes a new instance of . + public ResourceAssociation() { } - /// Initializes a new instance of . - /// - /// + /// Initializes a new instance of . + /// Name of the resource association. + /// Access mode of the resource association. /// Keeps track of any properties unknown to the library. - internal NspConfigAssociation(string name, string accessMode, IDictionary serializedAdditionalRawData) + internal ResourceAssociation(string name, ResourceAssociationAccessMode? accessMode, IDictionary serializedAdditionalRawData) { Name = name; AccessMode = accessMode; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets or sets the name. + /// Name of the resource association. [WirePath("name")] public string Name { get; set; } - /// Gets or sets the access mode. + /// Access mode of the resource association. [WirePath("accessMode")] - public string AccessMode { get; set; } + public ResourceAssociationAccessMode? AccessMode { get; set; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociationAccessMode.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociationAccessMode.cs new file mode 100644 index 000000000000..6e95e6853aa2 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/ResourceAssociationAccessMode.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.Search.Models +{ + /// Access mode of the resource association. + public readonly partial struct ResourceAssociationAccessMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceAssociationAccessMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnforcedValue = "Enforced"; + private const string LearningValue = "Learning"; + private const string AuditValue = "Audit"; + + /// Enforced access mode - traffic to the resource that failed access checks is blocked. + public static ResourceAssociationAccessMode Enforced { get; } = new ResourceAssociationAccessMode(EnforcedValue); + /// Learning access mode - traffic to the resource is enabled for analysis but not blocked. + public static ResourceAssociationAccessMode Learning { get; } = new ResourceAssociationAccessMode(LearningValue); + /// Audit access mode - traffic to the resource that fails access checks is logged but not blocked. + public static ResourceAssociationAccessMode Audit { get; } = new ResourceAssociationAccessMode(AuditValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceAssociationAccessMode left, ResourceAssociationAccessMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceAssociationAccessMode(string value) => new ResourceAssociationAccessMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceAssociationAccessMode other && Equals(other); + /// + public bool Equals(ResourceAssociationAccessMode 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/search/Azure.ResourceManager.Search/src/Generated/Models/SearchBypass.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchBypass.cs index 9096be9bac97..3841109fd30f 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchBypass.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchBypass.cs @@ -23,13 +23,10 @@ public SearchBypass(string value) } private const string NoneValue = "None"; - private const string AzurePortalValue = "AzurePortal"; private const string AzureServicesValue = "AzureServices"; /// Indicates that no origin can bypass the rules defined in the 'ipRules' section. This is the default. public static SearchBypass None { get; } = new SearchBypass(NoneValue); - /// Indicates that requests originating from the Azure portal can bypass the rules defined in the 'ipRules' section. - public static SearchBypass AzurePortal { get; } = new SearchBypass(AzurePortalValue); /// Indicates that requests originating from Azure trusted services can bypass the rules defined in the 'ipRules' section. public static SearchBypass AzureServices { get; } = new SearchBypass(AzureServicesValue); /// Determines if two values are the same. diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDataExfiltrationProtection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDataExfiltrationProtection.cs new file mode 100644 index 000000000000..015e70768395 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDataExfiltrationProtection.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.Search.Models +{ + /// A specific data exfiltration scenario that is disabled for the service. + public readonly partial struct SearchDataExfiltrationProtection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SearchDataExfiltrationProtection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string BlockAllValue = "BlockAll"; + + /// Indicates that all data exfiltration scenarios are disabled. + public static SearchDataExfiltrationProtection BlockAll { get; } = new SearchDataExfiltrationProtection(BlockAllValue); + /// Determines if two values are the same. + public static bool operator ==(SearchDataExfiltrationProtection left, SearchDataExfiltrationProtection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SearchDataExfiltrationProtection left, SearchDataExfiltrationProtection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SearchDataExfiltrationProtection(string value) => new SearchDataExfiltrationProtection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SearchDataExfiltrationProtection other && Equals(other); + /// + public bool Equals(SearchDataExfiltrationProtection 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/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDisabledDataExfiltrationOption.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDisabledDataExfiltrationOption.cs deleted file mode 100644 index 1ee16131fd4e..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchDisabledDataExfiltrationOption.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.Search.Models -{ - /// A specific data exfiltration scenario that is disabled for the service. - public readonly partial struct SearchDisabledDataExfiltrationOption : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SearchDisabledDataExfiltrationOption(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string AllValue = "All"; - - /// Indicates that all data exfiltration scenarios are disabled. - public static SearchDisabledDataExfiltrationOption All { get; } = new SearchDisabledDataExfiltrationOption(AllValue); - /// Determines if two values are the same. - public static bool operator ==(SearchDisabledDataExfiltrationOption left, SearchDisabledDataExfiltrationOption right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SearchDisabledDataExfiltrationOption left, SearchDisabledDataExfiltrationOption right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator SearchDisabledDataExfiltrationOption(string value) => new SearchDisabledDataExfiltrationOption(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SearchDisabledDataExfiltrationOption other && Equals(other); - /// - public bool Equals(SearchDisabledDataExfiltrationOption 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/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceComputeType.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceComputeType.cs index 57125a544052..103197b56a15 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceComputeType.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceComputeType.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Search.Models { - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. public readonly partial struct SearchServiceComputeType : IEquatable { private readonly string _value; @@ -25,7 +25,7 @@ public SearchServiceComputeType(string value) private const string DefaultValue = "default"; private const string ConfidentialValue = "confidential"; - /// Create the service with the default compute. + /// Create the service with the Default Compute. public static SearchServiceComputeType Default { get; } = new SearchServiceComputeType(DefaultValue); /// Create the service with Azure Confidential Compute. public static SearchServiceComputeType Confidential { get; } = new SearchServiceComputeType(ConfidentialValue); diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureName.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureName.cs deleted file mode 100644 index d424af09fa0a..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureName.cs +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.Search.Models -{ - /// The name of the feature offered in this region. - public readonly partial struct SearchServiceFeatureName : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public SearchServiceFeatureName(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string GrokValue = "Grok"; - private const string ImageVectorizationValue = "ImageVectorization"; - private const string DocumentIntelligenceValue = "DocumentIntelligence"; - private const string QueryRewriteValue = "QueryRewrite"; - private const string S3Value = "S3"; - private const string StorageOptimizedValue = "StorageOptimized"; - private const string SemanticSearchValue = "SemanticSearch"; - private const string MegaStoreValue = "MegaStore"; - private const string AvailabilityZonesValue = "AvailabilityZones"; - - /// Supports Grok feature. - public static SearchServiceFeatureName Grok { get; } = new SearchServiceFeatureName(GrokValue); - /// Supports Image Vectorization feature. - public static SearchServiceFeatureName ImageVectorization { get; } = new SearchServiceFeatureName(ImageVectorizationValue); - /// Supports Document Intelligence feature. - public static SearchServiceFeatureName DocumentIntelligence { get; } = new SearchServiceFeatureName(DocumentIntelligenceValue); - /// Supports Query Rewrite feature. - public static SearchServiceFeatureName QueryRewrite { get; } = new SearchServiceFeatureName(QueryRewriteValue); - /// Supports S3 feature. - public static SearchServiceFeatureName S3 { get; } = new SearchServiceFeatureName(S3Value); - /// Supports Storage Optimized feature. - public static SearchServiceFeatureName StorageOptimized { get; } = new SearchServiceFeatureName(StorageOptimizedValue); - /// Supports Semantic Search feature. - public static SearchServiceFeatureName SemanticSearch { get; } = new SearchServiceFeatureName(SemanticSearchValue); - /// Supports Mega Store feature. - public static SearchServiceFeatureName MegaStore { get; } = new SearchServiceFeatureName(MegaStoreValue); - /// Supports Availability Zones feature. - public static SearchServiceFeatureName AvailabilityZones { get; } = new SearchServiceFeatureName(AvailabilityZonesValue); - /// Determines if two values are the same. - public static bool operator ==(SearchServiceFeatureName left, SearchServiceFeatureName right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(SearchServiceFeatureName left, SearchServiceFeatureName right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator SearchServiceFeatureName(string value) => new SearchServiceFeatureName(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is SearchServiceFeatureName other && Equals(other); - /// - public bool Equals(SearchServiceFeatureName 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/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.Serialization.cs deleted file mode 100644 index 1bf3a25545f7..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.Serialization.cs +++ /dev/null @@ -1,166 +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; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - public partial class SearchServiceFeatureOffering : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SearchServiceFeatureOffering)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name.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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SearchServiceFeatureOffering 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(SearchServiceFeatureOffering)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSearchServiceFeatureOffering(document.RootElement, options); - } - - internal static SearchServiceFeatureOffering DeserializeSearchServiceFeatureOffering(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SearchServiceFeatureName? name = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - name = new SearchServiceFeatureName(property.Value.GetString()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SearchServiceFeatureOffering(name, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - builder.AppendLine($"'{Name.Value.ToString()}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(SearchServiceFeatureOffering)} does not support writing '{options.Format}' format."); - } - } - - SearchServiceFeatureOffering 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSearchServiceFeatureOffering(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SearchServiceFeatureOffering)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.cs deleted file mode 100644 index faa9c109d803..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceFeatureOffering.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.Search.Models -{ - /// The SearchServiceFeatureOffering. - public partial class SearchServiceFeatureOffering - { - /// - /// 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 SearchServiceFeatureOffering() - { - } - - /// Initializes a new instance of . - /// The name of the feature offered in this region. - /// Keeps track of any properties unknown to the library. - internal SearchServiceFeatureOffering(SearchServiceFeatureName? name, IDictionary serializedAdditionalRawData) - { - Name = name; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The name of the feature offered in this region. - [WirePath("name")] - public SearchServiceFeatureName? Name { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.Serialization.cs deleted file mode 100644 index 6b058999e29c..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.Serialization.cs +++ /dev/null @@ -1,267 +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.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - public partial class SearchServiceOfferingsByRegion : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SearchServiceOfferingsByRegion)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(RegionName)) - { - writer.WritePropertyName("regionName"u8); - writer.WriteStringValue(RegionName); - } - if (Optional.IsCollectionDefined(Features)) - { - writer.WritePropertyName("features"u8); - writer.WriteStartArray(); - foreach (var item in Features) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - 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" && _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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SearchServiceOfferingsByRegion 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(SearchServiceOfferingsByRegion)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSearchServiceOfferingsByRegion(document.RootElement, options); - } - - internal static SearchServiceOfferingsByRegion DeserializeSearchServiceOfferingsByRegion(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string regionName = default; - IReadOnlyList features = default; - IReadOnlyList skus = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("regionName"u8)) - { - regionName = property.Value.GetString(); - continue; - } - if (property.NameEquals("features"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(SearchServiceFeatureOffering.DeserializeSearchServiceFeatureOffering(item, options)); - } - features = array; - 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(SearchServiceSkuOffering.DeserializeSearchServiceSkuOffering(item, options)); - } - skus = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SearchServiceOfferingsByRegion(regionName, features ?? new ChangeTrackingList(), skus ?? new ChangeTrackingList(), serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RegionName), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" regionName: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RegionName)) - { - builder.Append(" regionName: "); - if (RegionName.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RegionName}'''"); - } - else - { - builder.AppendLine($"'{RegionName}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Features), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" features: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Features)) - { - if (Features.Any()) - { - builder.Append(" features: "); - builder.AppendLine("["); - foreach (var item in Features) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " features: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Skus), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" skus: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Skus)) - { - if (Skus.Any()) - { - builder.Append(" skus: "); - builder.AppendLine("["); - foreach (var item in Skus) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " skus: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(SearchServiceOfferingsByRegion)} does not support writing '{options.Format}' format."); - } - } - - SearchServiceOfferingsByRegion 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSearchServiceOfferingsByRegion(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SearchServiceOfferingsByRegion)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.cs deleted file mode 100644 index 2fe1729e91f9..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceOfferingsByRegion.cs +++ /dev/null @@ -1,78 +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.Search.Models -{ - /// The SearchServiceOfferingsByRegion. - public partial class SearchServiceOfferingsByRegion - { - /// - /// 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 SearchServiceOfferingsByRegion() - { - Features = new ChangeTrackingList(); - Skus = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The name of the region. - /// The list of features offered in this region. - /// The list of SKUs offered in this region. - /// Keeps track of any properties unknown to the library. - internal SearchServiceOfferingsByRegion(string regionName, IReadOnlyList features, IReadOnlyList skus, IDictionary serializedAdditionalRawData) - { - RegionName = regionName; - Features = features; - Skus = skus; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The name of the region. - [WirePath("regionName")] - public string RegionName { get; } - /// The list of features offered in this region. - [WirePath("features")] - public IReadOnlyList Features { get; } - /// The list of SKUs offered in this region. - [WirePath("skus")] - public IReadOnlyList Skus { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.Serialization.cs index da66884cf1df..4d7ce16178ea 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.Serialization.cs @@ -100,11 +100,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("networkRuleSet"u8); writer.WriteObjectValue(NetworkRuleSet, options); } - if (Optional.IsCollectionDefined(DisabledDataExfiltrationOptions)) + if (Optional.IsCollectionDefined(DataExfiltrationProtections)) { - writer.WritePropertyName("disabledDataExfiltrationOptions"u8); + writer.WritePropertyName("dataExfiltrationProtections"u8); writer.WriteStartArray(); - foreach (var item in DisabledDataExfiltrationOptions) + foreach (var item in DataExfiltrationProtections) { writer.WriteStringValue(item.ToString()); } @@ -169,15 +169,15 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("eTag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(IsUpgradeAvailable)) + if (Optional.IsDefined(IsUpgradeAvailable)) { writer.WritePropertyName("upgradeAvailable"u8); - writer.WriteBooleanValue(IsUpgradeAvailable.Value); + writer.WriteStringValue(IsUpgradeAvailable.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(ServiceUpgradeOn)) + if (options.Format != "W" && Optional.IsDefined(ServiceUpgradedOn)) { - writer.WritePropertyName("serviceUpgradeDate"u8); - writer.WriteStringValue(ServiceUpgradeOn.Value, "O"); + writer.WritePropertyName("serviceUpgradedAt"u8); + writer.WriteStringValue(ServiceUpgradedOn.Value, "O"); } writer.WriteEndObject(); } @@ -220,7 +220,7 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele string statusDetails = default; SearchServiceProvisioningState? provisioningState = default; SearchServiceNetworkRuleSet networkRuleSet = default; - IList disabledDataExfiltrationOptions = default; + IList dataExfiltrationProtections = default; SearchEncryptionWithCmk encryptionWithCmk = default; bool? disableLocalAuth = default; SearchAadAuthDataPlaneAuthOptions authOptions = default; @@ -228,8 +228,8 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele IReadOnlyList privateEndpointConnections = default; IReadOnlyList sharedPrivateLinkResources = default; ETag? eTag = default; - bool? upgradeAvailable = default; - DateTimeOffset? serviceUpgradeDate = default; + UpgradeAvailable? upgradeAvailable = default; + DateTimeOffset? serviceUpgradedAt = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -390,18 +390,18 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele networkRuleSet = SearchServiceNetworkRuleSet.DeserializeSearchServiceNetworkRuleSet(property0.Value, options); continue; } - if (property0.NameEquals("disabledDataExfiltrationOptions"u8)) + if (property0.NameEquals("dataExfiltrationProtections"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(new SearchDisabledDataExfiltrationOption(item.GetString())); + array.Add(new SearchDataExfiltrationProtection(item.GetString())); } - disabledDataExfiltrationOptions = array; + dataExfiltrationProtections = array; continue; } if (property0.NameEquals("encryptionWithCmk"u8)) @@ -485,16 +485,16 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele { continue; } - upgradeAvailable = property0.Value.GetBoolean(); + upgradeAvailable = new UpgradeAvailable(property0.Value.GetString()); continue; } - if (property0.NameEquals("serviceUpgradeDate"u8)) + if (property0.NameEquals("serviceUpgradedAt"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - serviceUpgradeDate = property0.Value.GetDateTimeOffset("O"); + serviceUpgradedAt = property0.Value.GetDateTimeOffset("O"); continue; } } @@ -525,7 +525,7 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele statusDetails, provisioningState, networkRuleSet, - disabledDataExfiltrationOptions ?? new ChangeTrackingList(), + dataExfiltrationProtections ?? new ChangeTrackingList(), encryptionWithCmk, disableLocalAuth, authOptions, @@ -534,7 +534,7 @@ internal static SearchServicePatch DeserializeSearchServicePatch(JsonElement ele sharedPrivateLinkResources ?? new ChangeTrackingList(), eTag, upgradeAvailable, - serviceUpgradeDate, + serviceUpgradedAt, serializedAdditionalRawData); } @@ -844,21 +844,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisabledDataExfiltrationOptions), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataExfiltrationProtections), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" disabledDataExfiltrationOptions: "); + builder.Append(" dataExfiltrationProtections: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(DisabledDataExfiltrationOptions)) + if (Optional.IsCollectionDefined(DataExfiltrationProtections)) { - if (DisabledDataExfiltrationOptions.Any()) + if (DataExfiltrationProtections.Any()) { - builder.Append(" disabledDataExfiltrationOptions: "); + builder.Append(" dataExfiltrationProtections: "); builder.AppendLine("["); - foreach (var item in DisabledDataExfiltrationOptions) + foreach (var item in DataExfiltrationProtections) { builder.AppendLine($" '{item.ToString()}'"); } @@ -1000,23 +1000,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(IsUpgradeAvailable)) { builder.Append(" upgradeAvailable: "); - var boolValue = IsUpgradeAvailable.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.AppendLine($"'{IsUpgradeAvailable.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceUpgradeOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceUpgradedOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" serviceUpgradeDate: "); + builder.Append(" serviceUpgradedAt: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ServiceUpgradeOn)) + if (Optional.IsDefined(ServiceUpgradedOn)) { - builder.Append(" serviceUpgradeDate: "); - var formattedDateTimeString = TypeFormatters.ToString(ServiceUpgradeOn.Value, "o"); + builder.Append(" serviceUpgradedAt: "); + var formattedDateTimeString = TypeFormatters.ToString(ServiceUpgradedOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.cs index 2698d1cb18b9..430ffa220a75 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePatch.cs @@ -51,7 +51,7 @@ public partial class SearchServicePatch : TrackedResourceData /// The location. public SearchServicePatch(AzureLocation location) : base(location) { - DisabledDataExfiltrationOptions = new ChangeTrackingList(); + DataExfiltrationProtections = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); SharedPrivateLinkResources = new ChangeTrackingList(); } @@ -69,13 +69,13 @@ public SearchServicePatch(AzureLocation location) : base(location) /// The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. /// The endpoint of the Azure AI Search service. /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. /// The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. /// The details of the search service status. /// The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'Succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up. /// Network specific rules that determine how the Azure AI Search service may be reached. - /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. + /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. /// When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. /// Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. @@ -83,10 +83,10 @@ public SearchServicePatch(AzureLocation location) : base(location) /// The list of private endpoint connections to the Azure AI Search service. /// The list of shared private link resources managed by the Azure AI Search service. /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. - /// Indicates whether or not the search service has an upgrade available. - /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. + /// Indicates if the search service has an upgrade available. + /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. /// Keeps track of any properties unknown to the library. - internal SearchServicePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SearchSku searchSku, ManagedServiceIdentity identity, int? replicaCount, int? partitionCount, Uri endpoint, SearchServiceHostingMode? hostingMode, SearchServiceComputeType? computeType, SearchServicePublicInternetAccess? publicInternetAccess, SearchServiceStatus? status, string statusDetails, SearchServiceProvisioningState? provisioningState, SearchServiceNetworkRuleSet networkRuleSet, IList disabledDataExfiltrationOptions, SearchEncryptionWithCmk encryptionWithCmk, bool? isLocalAuthDisabled, SearchAadAuthDataPlaneAuthOptions authOptions, SearchSemanticSearch? semanticSearch, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, ETag? eTag, bool? isUpgradeAvailable, DateTimeOffset? serviceUpgradeOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal SearchServicePatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SearchSku searchSku, ManagedServiceIdentity identity, int? replicaCount, int? partitionCount, Uri endpoint, SearchServiceHostingMode? hostingMode, SearchServiceComputeType? computeType, SearchServicePublicInternetAccess? publicInternetAccess, SearchServiceStatus? status, string statusDetails, SearchServiceProvisioningState? provisioningState, SearchServiceNetworkRuleSet networkRuleSet, IList dataExfiltrationProtections, SearchEncryptionWithCmk encryptionWithCmk, bool? isLocalAuthDisabled, SearchAadAuthDataPlaneAuthOptions authOptions, SearchSemanticSearch? semanticSearch, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, ETag? eTag, UpgradeAvailable? isUpgradeAvailable, DateTimeOffset? serviceUpgradedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { SearchSku = searchSku; Identity = identity; @@ -100,7 +100,7 @@ internal SearchServicePatch(ResourceIdentifier id, string name, ResourceType res StatusDetails = statusDetails; ProvisioningState = provisioningState; NetworkRuleSet = networkRuleSet; - DisabledDataExfiltrationOptions = disabledDataExfiltrationOptions; + DataExfiltrationProtections = dataExfiltrationProtections; EncryptionWithCmk = encryptionWithCmk; IsLocalAuthDisabled = isLocalAuthDisabled; AuthOptions = authOptions; @@ -109,7 +109,7 @@ internal SearchServicePatch(ResourceIdentifier id, string name, ResourceType res SharedPrivateLinkResources = sharedPrivateLinkResources; ETag = eTag; IsUpgradeAvailable = isUpgradeAvailable; - ServiceUpgradeOn = serviceUpgradeOn; + ServiceUpgradedOn = serviceUpgradedOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -148,7 +148,7 @@ public SearchServiceSkuName? SearchSkuName /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. [WirePath("properties.hostingMode")] public SearchServiceHostingMode? HostingMode { get; set; } - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. [WirePath("properties.computeType")] public SearchServiceComputeType? ComputeType { get; set; } /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. @@ -167,8 +167,8 @@ public SearchServiceSkuName? SearchSkuName [WirePath("properties.networkRuleSet")] public SearchServiceNetworkRuleSet NetworkRuleSet { get; set; } /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. - [WirePath("properties.disabledDataExfiltrationOptions")] - public IList DisabledDataExfiltrationOptions { get; } + [WirePath("properties.dataExfiltrationProtections")] + public IList DataExfiltrationProtections { get; } /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. [WirePath("properties.encryptionWithCmk")] public SearchEncryptionWithCmk EncryptionWithCmk { get; set; } @@ -190,11 +190,11 @@ public SearchServiceSkuName? SearchSkuName /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. [WirePath("properties.eTag")] public ETag? ETag { get; } - /// Indicates whether or not the search service has an upgrade available. + /// Indicates if the search service has an upgrade available. [WirePath("properties.upgradeAvailable")] - public bool? IsUpgradeAvailable { get; } + public UpgradeAvailable? IsUpgradeAvailable { get; set; } /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. - [WirePath("properties.serviceUpgradeDate")] - public DateTimeOffset? ServiceUpgradeOn { get; } + [WirePath("properties.serviceUpgradedAt")] + public DateTimeOffset? ServiceUpgradedOn { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceProvisioningState.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceProvisioningState.Serialization.cs index 0f9759951994..0c29a1a9066c 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceProvisioningState.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceProvisioningState.Serialization.cs @@ -13,17 +13,17 @@ internal static partial class SearchServiceProvisioningStateExtensions { public static string ToSerialString(this SearchServiceProvisioningState value) => value switch { - SearchServiceProvisioningState.Succeeded => "Succeeded", - SearchServiceProvisioningState.Provisioning => "Provisioning", - SearchServiceProvisioningState.Failed => "Failed", + SearchServiceProvisioningState.Succeeded => "succeeded", + SearchServiceProvisioningState.Provisioning => "provisioning", + SearchServiceProvisioningState.Failed => "failed", _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchServiceProvisioningState value.") }; public static SearchServiceProvisioningState ToSearchServiceProvisioningState(this string value) { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Succeeded")) return SearchServiceProvisioningState.Succeeded; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Provisioning")) return SearchServiceProvisioningState.Provisioning; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Failed")) return SearchServiceProvisioningState.Failed; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "succeeded")) return SearchServiceProvisioningState.Succeeded; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "provisioning")) return SearchServiceProvisioningState.Provisioning; + if (StringComparer.OrdinalIgnoreCase.Equals(value, "failed")) return SearchServiceProvisioningState.Failed; throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown SearchServiceProvisioningState value."); } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePublicInternetAccess.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePublicInternetAccess.cs index 2923f1301367..cfb2818f2fb8 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePublicInternetAccess.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServicePublicInternetAccess.cs @@ -24,11 +24,14 @@ public SearchServicePublicInternetAccess(string value) private const string EnabledValue = "enabled"; private const string DisabledValue = "disabled"; + private const string SecuredByPerimeterValue = "securedByPerimeter"; /// The search service is accessible from traffic originating from the public internet. public static SearchServicePublicInternetAccess Enabled { get; } = new SearchServicePublicInternetAccess(EnabledValue); /// The search service is not accessible from traffic originating from the public internet. Access is only permitted over approved private endpoint connections. public static SearchServicePublicInternetAccess Disabled { get; } = new SearchServicePublicInternetAccess(DisabledValue); + /// The network security perimeter configuration rules allow or disallow public network access to the resource. Requires an associated network security perimeter. + public static SearchServicePublicInternetAccess SecuredByPerimeter { get; } = new SearchServicePublicInternetAccess(SecuredByPerimeterValue); /// Determines if two values are the same. public static bool operator ==(SearchServicePublicInternetAccess left, SearchServicePublicInternetAccess right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.Serialization.cs deleted file mode 100644 index 0bf6561f2511..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.Serialization.cs +++ /dev/null @@ -1,199 +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; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - public partial class SearchServiceSkuOffering : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SearchServiceSkuOffering)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku, options); - } - if (Optional.IsDefined(Limits)) - { - writer.WritePropertyName("limits"u8); - writer.WriteObjectValue(Limits, 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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SearchServiceSkuOffering 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(SearchServiceSkuOffering)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSearchServiceSkuOffering(document.RootElement, options); - } - - internal static SearchServiceSkuOffering DeserializeSearchServiceSkuOffering(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - SearchSku sku = default; - SearchServiceSkuOfferingLimits limits = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("sku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sku = SearchSku.DeserializeSearchSku(property.Value, options); - continue; - } - if (property.NameEquals("limits"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - limits = SearchServiceSkuOfferingLimits.DeserializeSearchServiceSkuOfferingLimits(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SearchServiceSkuOffering(sku, limits, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SkuName", out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" sku: "); - builder.AppendLine("{"); - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - builder.AppendLine(" }"); - } - else - { - if (Optional.IsDefined(Sku)) - { - builder.Append(" sku: "); - BicepSerializationHelpers.AppendChildObject(builder, Sku, options, 2, false, " sku: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Limits), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" limits: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Limits)) - { - builder.Append(" limits: "); - BicepSerializationHelpers.AppendChildObject(builder, Limits, options, 2, false, " limits: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(SearchServiceSkuOffering)} does not support writing '{options.Format}' format."); - } - } - - SearchServiceSkuOffering 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSearchServiceSkuOffering(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SearchServiceSkuOffering)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.cs deleted file mode 100644 index a134678f8695..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOffering.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.Search.Models -{ - /// The SearchServiceSkuOffering. - public partial class SearchServiceSkuOffering - { - /// - /// 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 SearchServiceSkuOffering() - { - } - - /// Initializes a new instance of . - /// Defines the SKU of a search service, which determines billing rate and capacity limits. - /// The limits associated with this SKU offered in this region. - /// Keeps track of any properties unknown to the library. - internal SearchServiceSkuOffering(SearchSku sku, SearchServiceSkuOfferingLimits limits, IDictionary serializedAdditionalRawData) - { - Sku = sku; - Limits = limits; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Defines the SKU of a search service, which determines billing rate and capacity limits. - internal SearchSku Sku { get; } - /// The SKU of the search service. Valid values include: 'free': Shared service. 'basic': Dedicated service with up to 3 replicas. 'standard': Dedicated service with up to 12 partitions and 12 replicas. 'standard2': Similar to standard, but with more capacity per search unit. 'standard3': The largest Standard offering with up to 12 partitions and 12 replicas (or up to 3 partitions with more indexes if you also set the hostingMode property to 'highDensity'). 'storage_optimized_l1': Supports 1TB per partition, up to 12 partitions. 'storage_optimized_l2': Supports 2TB per partition, up to 12 partitions.'. - [WirePath("sku.name")] - public SearchServiceSkuName? SkuName - { - get => Sku?.Name; - } - - /// The limits associated with this SKU offered in this region. - [WirePath("limits")] - public SearchServiceSkuOfferingLimits Limits { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.Serialization.cs deleted file mode 100644 index a945ccf7247a..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.Serialization.cs +++ /dev/null @@ -1,354 +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; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.Search.Models -{ - public partial class SearchServiceSkuOfferingLimits : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(SearchServiceSkuOfferingLimits)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Indexes)) - { - writer.WritePropertyName("indexes"u8); - writer.WriteNumberValue(Indexes.Value); - } - if (Optional.IsDefined(Indexers)) - { - writer.WritePropertyName("indexers"u8); - writer.WriteNumberValue(Indexers.Value); - } - if (Optional.IsDefined(PartitionStorageInGigabytes)) - { - writer.WritePropertyName("partitionStorageInGigabytes"u8); - writer.WriteNumberValue(PartitionStorageInGigabytes.Value); - } - if (Optional.IsDefined(PartitionVectorStorageInGigabytes)) - { - writer.WritePropertyName("partitionVectorStorageInGigabytes"u8); - writer.WriteNumberValue(PartitionVectorStorageInGigabytes.Value); - } - if (Optional.IsDefined(SearchUnits)) - { - writer.WritePropertyName("searchUnits"u8); - writer.WriteNumberValue(SearchUnits.Value); - } - if (Optional.IsDefined(Replicas)) - { - writer.WritePropertyName("replicas"u8); - writer.WriteNumberValue(Replicas.Value); - } - if (Optional.IsDefined(Partitions)) - { - writer.WritePropertyName("partitions"u8); - writer.WriteNumberValue(Partitions.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, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - SearchServiceSkuOfferingLimits 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(SearchServiceSkuOfferingLimits)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSearchServiceSkuOfferingLimits(document.RootElement, options); - } - - internal static SearchServiceSkuOfferingLimits DeserializeSearchServiceSkuOfferingLimits(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - int? indexes = default; - int? indexers = default; - float? partitionStorageInGigabytes = default; - float? partitionVectorStorageInGigabytes = default; - int? searchUnits = default; - int? replicas = default; - int? partitions = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("indexes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - indexes = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("indexers"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - indexers = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("partitionStorageInGigabytes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - partitionStorageInGigabytes = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("partitionVectorStorageInGigabytes"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - partitionVectorStorageInGigabytes = property.Value.GetSingle(); - continue; - } - if (property.NameEquals("searchUnits"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - searchUnits = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("replicas"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - replicas = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("partitions"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - partitions = property.Value.GetInt32(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new SearchServiceSkuOfferingLimits( - indexes, - indexers, - partitionStorageInGigabytes, - partitionVectorStorageInGigabytes, - searchUnits, - replicas, - partitions, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Indexes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" indexes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Indexes)) - { - builder.Append(" indexes: "); - builder.AppendLine($"{Indexes.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Indexers), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" indexers: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Indexers)) - { - builder.Append(" indexers: "); - builder.AppendLine($"{Indexers.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartitionStorageInGigabytes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" partitionStorageInGigabytes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PartitionStorageInGigabytes)) - { - builder.Append(" partitionStorageInGigabytes: "); - builder.AppendLine($"'{PartitionStorageInGigabytes.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PartitionVectorStorageInGigabytes), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" partitionVectorStorageInGigabytes: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(PartitionVectorStorageInGigabytes)) - { - builder.Append(" partitionVectorStorageInGigabytes: "); - builder.AppendLine($"'{PartitionVectorStorageInGigabytes.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SearchUnits), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" searchUnits: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SearchUnits)) - { - builder.Append(" searchUnits: "); - builder.AppendLine($"{SearchUnits.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Replicas), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" replicas: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Replicas)) - { - builder.Append(" replicas: "); - builder.AppendLine($"{Replicas.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Partitions), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" partitions: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Partitions)) - { - builder.Append(" partitions: "); - builder.AppendLine($"{Partitions.Value}"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - 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); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(SearchServiceSkuOfferingLimits)} does not support writing '{options.Format}' format."); - } - } - - SearchServiceSkuOfferingLimits 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, ModelSerializationExtensions.JsonDocumentOptions); - return DeserializeSearchServiceSkuOfferingLimits(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(SearchServiceSkuOfferingLimits)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.cs deleted file mode 100644 index 3752a52646d0..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/SearchServiceSkuOfferingLimits.cs +++ /dev/null @@ -1,96 +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.Search.Models -{ - /// The limits associated with this SKU offered in this region. - public partial class SearchServiceSkuOfferingLimits - { - /// - /// 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 SearchServiceSkuOfferingLimits() - { - } - - /// Initializes a new instance of . - /// The maximum number of indexes available for this SKU. - /// The maximum number of indexers available for this SKU. - /// The maximum storage size in Gigabytes available for this SKU per partition. - /// The maximum vector storage size in Gigabytes available for this SKU per partition. - /// The maximum number of search units available for this SKU. - /// The maximum number of replicas available for this SKU. - /// The maximum number of partitions available for this SKU. - /// Keeps track of any properties unknown to the library. - internal SearchServiceSkuOfferingLimits(int? indexes, int? indexers, float? partitionStorageInGigabytes, float? partitionVectorStorageInGigabytes, int? searchUnits, int? replicas, int? partitions, IDictionary serializedAdditionalRawData) - { - Indexes = indexes; - Indexers = indexers; - PartitionStorageInGigabytes = partitionStorageInGigabytes; - PartitionVectorStorageInGigabytes = partitionVectorStorageInGigabytes; - SearchUnits = searchUnits; - Replicas = replicas; - Partitions = partitions; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The maximum number of indexes available for this SKU. - [WirePath("indexes")] - public int? Indexes { get; } - /// The maximum number of indexers available for this SKU. - [WirePath("indexers")] - public int? Indexers { get; } - /// The maximum storage size in Gigabytes available for this SKU per partition. - [WirePath("partitionStorageInGigabytes")] - public float? PartitionStorageInGigabytes { get; } - /// The maximum vector storage size in Gigabytes available for this SKU per partition. - [WirePath("partitionVectorStorageInGigabytes")] - public float? PartitionVectorStorageInGigabytes { get; } - /// The maximum number of search units available for this SKU. - [WirePath("searchUnits")] - public int? SearchUnits { get; } - /// The maximum number of replicas available for this SKU. - [WirePath("replicas")] - public int? Replicas { get; } - /// The maximum number of partitions available for this SKU. - [WirePath("partitions")] - public int? Partitions { get; } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/Severity.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/Severity.cs new file mode 100644 index 000000000000..cb0331aef7b4 --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/Severity.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.Search.Models +{ + /// Severity of the issue. + public readonly partial struct Severity : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public Severity(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WarningValue = "Warning"; + private const string ErrorValue = "Error"; + + /// Warning. + public static Severity Warning { get; } = new Severity(WarningValue); + /// Error. + public static Severity Error { get; } = new Severity(ErrorValue); + /// Determines if two values are the same. + public static bool operator ==(Severity left, Severity right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(Severity left, Severity right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator Severity(string value) => new Severity(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Severity other && Equals(other); + /// + public bool Equals(Severity 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/search/Azure.ResourceManager.Search/src/Generated/Models/UpgradeAvailable.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/UpgradeAvailable.cs new file mode 100644 index 000000000000..16572fb507ab --- /dev/null +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/Models/UpgradeAvailable.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.Search.Models +{ + /// Indicates if the search service has an upgrade available. + public readonly partial struct UpgradeAvailable : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpgradeAvailable(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotAvailableValue = "notAvailable"; + private const string AvailableValue = "available"; + + /// An upgrade is currently not available for the service. + public static UpgradeAvailable NotAvailable { get; } = new UpgradeAvailable(NotAvailableValue); + /// There is an upgrade available for the service. + public static UpgradeAvailable Available { get; } = new UpgradeAvailable(AvailableValue); + /// Determines if two values are the same. + public static bool operator ==(UpgradeAvailable left, UpgradeAvailable right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpgradeAvailable left, UpgradeAvailable right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UpgradeAvailable(string value) => new UpgradeAvailable(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpgradeAvailable other && Equals(other); + /// + public bool Equals(UpgradeAvailable 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/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index 0d683769bcb3..9be3af23e08f 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -72,7 +72,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -222,7 +222,7 @@ public virtual Pageable GetAll(Ca /// /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string nspConfigName, Canc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual async Task> ExistsAsync(string nspConfigName, Canc /// /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -300,7 +300,7 @@ public virtual Response Exists(string nspConfigName, CancellationToken can /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Response Exists(string nspConfigName, CancellationToken can /// /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs index a047985f9510..302726de4777 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs @@ -8,7 +8,6 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; -using System.Linq; using System.Text; using System.Text.Json; using Azure.Core; @@ -39,39 +38,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - writer.WritePropertyName("networkSecurityPerimeter"u8); - writer.WriteObjectValue(NetworkSecurityPerimeter, options); - } - if (Optional.IsDefined(ResourceAssociation)) - { - writer.WritePropertyName("resourceAssociation"u8); - writer.WriteObjectValue(ResourceAssociation, options); - } - if (Optional.IsDefined(Profile)) + if (Optional.IsDefined(Properties)) { - writer.WritePropertyName("profile"u8); - writer.WriteObjectValue(Profile, options); + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); } - if (Optional.IsCollectionDefined(ProvisioningIssues)) - { - writer.WritePropertyName("provisioningIssues"u8); - writer.WriteStartArray(); - foreach (var item in ProvisioningIssues) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); } NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -94,19 +65,24 @@ internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecu { return null; } + NetworkSecurityPerimeterConfigurationProperties properties = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; SystemData systemData = default; - string provisioningState = default; - NspConfigPerimeter networkSecurityPerimeter = default; - NspConfigAssociation resourceAssociation = default; - NspConfigProfile profile = default; - IList provisioningIssues = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = NetworkSecurityPerimeterConfigurationProperties.DeserializeNetworkSecurityPerimeterConfigurationProperties(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -131,64 +107,6 @@ internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecu systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("networkSecurityPerimeter"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - networkSecurityPerimeter = NspConfigPerimeter.DeserializeNspConfigPerimeter(property0.Value, options); - continue; - } - if (property0.NameEquals("resourceAssociation"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - resourceAssociation = NspConfigAssociation.DeserializeNspConfigAssociation(property0.Value, options); - continue; - } - if (property0.NameEquals("profile"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - profile = NspConfigProfile.DeserializeNspConfigProfile(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningIssues"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(NspProvisioningIssue.DeserializeNspProvisioningIssue(item, options)); - } - provisioningIssues = array; - continue; - } - } - continue; - } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -200,11 +118,7 @@ internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecu name, type, systemData, - provisioningState, - networkSecurityPerimeter, - resourceAssociation, - profile, - provisioningIssues ?? new ChangeTrackingList(), + properties, serializedAdditionalRawData); } @@ -242,130 +156,51 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - if (ProvisioningState.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ProvisioningState}'''"); - } - else - { - builder.AppendLine($"'{ProvisioningState}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" networkSecurityPerimeter: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NetworkSecurityPerimeter)) - { - builder.Append(" networkSecurityPerimeter: "); - BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 4, false, " networkSecurityPerimeter: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Properties), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" resourceAssociation: "); + builder.Append(" properties: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ResourceAssociation)) + if (Optional.IsDefined(Properties)) { - builder.Append(" resourceAssociation: "); - BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 4, false, " resourceAssociation: "); + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" profile: "); + builder.Append(" id: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(Profile)) + if (Optional.IsDefined(Id)) { - builder.Append(" profile: "); - BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 4, false, " profile: "); + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" provisioningIssues: "); + builder.Append(" systemData: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(ProvisioningIssues)) + if (Optional.IsDefined(SystemData)) { - if (ProvisioningIssues.Any()) - { - builder.Append(" provisioningIssues: "); - builder.AppendLine("["); - foreach (var item in ProvisioningIssues) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " provisioningIssues: "); - } - builder.AppendLine(" ]"); - } + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); } } - builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.cs index a46b54fe3a32..bae1d85cfc95 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.Search { /// /// A class representing the NetworkSecurityPerimeterConfiguration data model. - /// Network security perimeter configuration for a server. + /// Network security perimeter (NSP) configuration resource /// public partial class NetworkSecurityPerimeterConfigurationData : ResourceData { @@ -54,7 +54,6 @@ public partial class NetworkSecurityPerimeterConfigurationData : ResourceData /// Initializes a new instance of . public NetworkSecurityPerimeterConfigurationData() { - ProvisioningIssues = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -62,36 +61,16 @@ public NetworkSecurityPerimeterConfigurationData() /// The name. /// The resourceType. /// The systemData. - /// - /// The perimeter for a network security perimeter configuration. - /// The resource association for the network security perimeter. - /// The profile for a network security perimeter configuration. - /// + /// Network security configuration properties. /// Keeps track of any properties unknown to the library. - internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string provisioningState, NspConfigPerimeter networkSecurityPerimeter, NspConfigAssociation resourceAssociation, NspConfigProfile profile, IList provisioningIssues, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NetworkSecurityPerimeterConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - ProvisioningState = provisioningState; - NetworkSecurityPerimeter = networkSecurityPerimeter; - ResourceAssociation = resourceAssociation; - Profile = profile; - ProvisioningIssues = provisioningIssues; + Properties = properties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the provisioning state. - [WirePath("properties.provisioningState")] - public string ProvisioningState { get; } - /// The perimeter for a network security perimeter configuration. - [WirePath("properties.networkSecurityPerimeter")] - public NspConfigPerimeter NetworkSecurityPerimeter { get; set; } - /// The resource association for the network security perimeter. - [WirePath("properties.resourceAssociation")] - public NspConfigAssociation ResourceAssociation { get; set; } - /// The profile for a network security perimeter configuration. - [WirePath("properties.profile")] - public NspConfigProfile Profile { get; set; } - /// Gets the provisioning issues. - [WirePath("properties.provisioningIssues")] - public IList ProvisioningIssues { get; } + /// Network security configuration properties. + [WirePath("properties")] + public NetworkSecurityPerimeterConfigurationProperties Properties { get; set; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 1b03582779ad..3e55524e2f61 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Cance /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task ReconcileAsync(WaitUntil waitUntil, Canc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/AdminKeysRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/AdminKeysRestOperations.cs index a5b39a26c410..bf7373bb56e8 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/AdminKeysRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/AdminKeysRestOperations.cs @@ -32,7 +32,7 @@ public AdminKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs index 7881c84a1115..4dd61a2efbd2 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -172,7 +172,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the Azure AI Search service associated with the specified resource group. - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -205,7 +205,7 @@ public async Task> GetAsync( /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the Azure AI Search service associated with the specified resource group. - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -278,7 +278,7 @@ internal HttpMessage CreateReconcileRequest(string subscriptionId, string resour /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the Azure AI Search service associated with the specified resource group. - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. @@ -304,7 +304,7 @@ public async Task ReconcileAsync(string subscriptionId, string resourc /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the Azure AI Search service associated with the specified resource group. - /// The network security configuration name. + /// The network security perimeter configuration 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/search/Azure.ResourceManager.Search/src/Generated/RestOperations/OfferingsRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/OfferingsRestOperations.cs deleted file mode 100644 index ab0623465aec..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/OfferingsRestOperations.cs +++ /dev/null @@ -1,103 +0,0 @@ -// 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.Search.Models; - -namespace Azure.ResourceManager.Search -{ - internal partial class OfferingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of OfferingsRestOperations. - /// 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 OfferingsRestOperations(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 ?? "2025-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateListRequestUri() - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.Search/offerings", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListRequest() - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/providers/Microsoft.Search/offerings", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// The cancellation token to use. - public async Task> ListAsync(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OfferingsListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all of the features and SKUs offered by the Azure AI Search service in each region. - /// The cancellation token to use. - public Response List(CancellationToken cancellationToken = default) - { - using var message = CreateListRequest(); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OfferingsListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = OfferingsListResult.DeserializeOfferingsListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 0154071832fb..dd28791cbf32 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/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 ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 05f482d22dcc..ff1a78bda0b2 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/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 ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/QueryKeysRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/QueryKeysRestOperations.cs index e343d573800c..7054126d95cd 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/QueryKeysRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/QueryKeysRestOperations.cs @@ -32,7 +32,7 @@ public QueryKeysRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SearchManagementRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SearchManagementRestOperations.cs index 80410e504705..36dd8f9ef777 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SearchManagementRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SearchManagementRestOperations.cs @@ -32,7 +32,7 @@ public SearchManagementRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServiceRestOperations.cs deleted file mode 100644 index ff8597fb676c..000000000000 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServiceRestOperations.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.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.Search -{ - internal partial class ServiceRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of ServiceRestOperations. - /// 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 ServiceRestOperations(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 ?? "2025-02-01-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateUpgradeRequestUri(string subscriptionId, string resourceGroupName, string searchServiceName) - { - 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.Search/searchServices/", false); - uri.AppendPath(searchServiceName, true); - uri.AppendPath("/upgrade", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resourceGroupName, string searchServiceName) - { - 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.Search/searchServices/", false); - uri.AppendPath(searchServiceName, true); - uri.AppendPath("/upgrade", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Upgrades the Azure AI Search service to the latest version available. - /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the Azure AI Search service associated with the specified resource group. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpgradeAsync(string subscriptionId, string resourceGroupName, string searchServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(searchServiceName, nameof(searchServiceName)); - - using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, searchServiceName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Upgrades the Azure AI Search service to the latest version available. - /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the Azure AI Search service associated with the specified resource group. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Upgrade(string subscriptionId, string resourceGroupName, string searchServiceName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(searchServiceName, nameof(searchServiceName)); - - using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, searchServiceName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServicesRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServicesRestOperations.cs index 0da04517a7d9..71edc98d4d9c 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServicesRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/ServicesRestOperations.cs @@ -32,7 +32,7 @@ public ServicesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -77,7 +77,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. /// The definition of the search service to create or update. /// Parameter group. /// The cancellation token to use. @@ -105,7 +105,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// Creates or updates a search service in the given resource group. If the search service already exists, all properties will be updated with the given values. /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. - /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. /// The definition of the search service to create or update. /// Parameter group. /// The cancellation token to use. @@ -674,6 +674,92 @@ public Response CheckNameAvailability(strin } } + internal RequestUriBuilder CreateUpgradeRequestUri(string subscriptionId, string resourceGroupName, string searchServiceName) + { + 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.Search/searchServices/", false); + uri.AppendPath(searchServiceName, true); + uri.AppendPath("/upgrade", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpgradeRequest(string subscriptionId, string resourceGroupName, string searchServiceName) + { + 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.Search/searchServices/", false); + uri.AppendPath(searchServiceName, true); + uri.AppendPath("/upgrade", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Upgrades the Azure AI Search service to the latest version available. + /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the Azure AI Search service associated with the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpgradeAsync(string subscriptionId, string resourceGroupName, string searchServiceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(searchServiceName, nameof(searchServiceName)); + + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, searchServiceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Upgrades the Azure AI Search service to the latest version available. + /// The unique identifier for a Microsoft Azure subscription. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the resource group within the current subscription. You can obtain this value from the Azure Resource Manager API or the portal. + /// The name of the Azure AI Search service associated with the specified resource group. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Upgrade(string subscriptionId, string resourceGroupName, string searchServiceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(searchServiceName, nameof(searchServiceName)); + + using var message = CreateUpgradeRequest(subscriptionId, resourceGroupName, searchServiceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, SearchManagementRequestOptions searchManagementRequestOptions) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs index 8d04656e7830..ab50a78de7d0 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/SharedPrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public SharedPrivateLinkResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/UsagesRestOperations.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/UsagesRestOperations.cs index 6dacbcb8b88c..2c26c684c819 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/RestOperations/UsagesRestOperations.cs +++ b/sdk/search/Azure.ResourceManager.Search/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 ?? "2025-02-01-preview"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionCollection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionCollection.cs index a7ba13c7d54d..d0efbb2252af 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -117,7 +117,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -169,7 +169,7 @@ public virtual ArmOperation CreateOrUpd /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -215,7 +215,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -261,7 +261,7 @@ public virtual Response Get(string priv /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetAll(SearchMa /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -367,7 +367,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -411,7 +411,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -457,7 +457,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionResource.cs index 9f81d38faf39..11e63fe001b4 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchPrivateEndpointConnectionResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(SearchManag /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -229,7 +229,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -274,7 +274,7 @@ public virtual ArmOperation Delete(Wait /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -323,7 +323,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceCollection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceCollection.cs index 76e1ecf46853..9e7c2aef855c 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceCollection.cs @@ -66,7 +66,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -75,7 +75,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. - /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. /// The definition of the search service to create or update. /// Parameter group. /// The cancellation token to use. @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -125,7 +125,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// 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 Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be globally unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. + /// The name of the Azure AI Search service to create or update. Search service names must only contain lowercase letters, digits or dashes, cannot use dash as the first two or last one characters, cannot contain consecutive dashes, and must be between 2 and 60 characters in length. Search service names must be unique since they are part of the service URI (https://<name>.search.windows.net). You cannot change the service name after the service is created. /// The definition of the search service to create or update. /// Parameter group. /// The cancellation token to use. @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -258,7 +258,7 @@ public virtual Response Get(string searchServiceName, Sea /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -289,7 +289,7 @@ public virtual AsyncPageable GetAllAsync(SearchManagement /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -320,7 +320,7 @@ public virtual Pageable GetAll(SearchManagementRequestOpt /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -364,7 +364,7 @@ public virtual async Task> ExistsAsync(string searchServiceName, /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -408,7 +408,7 @@ public virtual Response Exists(string searchServiceName, SearchManagementR /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -454,7 +454,7 @@ public virtual async Task> GetIfExistsAs /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.Serialization.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.Serialization.cs index a312ca36b42a..66e95007f0fe 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.Serialization.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.Serialization.cs @@ -101,11 +101,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("networkRuleSet"u8); writer.WriteObjectValue(NetworkRuleSet, options); } - if (Optional.IsCollectionDefined(DisabledDataExfiltrationOptions)) + if (Optional.IsCollectionDefined(DataExfiltrationProtections)) { - writer.WritePropertyName("disabledDataExfiltrationOptions"u8); + writer.WritePropertyName("dataExfiltrationProtections"u8); writer.WriteStartArray(); - foreach (var item in DisabledDataExfiltrationOptions) + foreach (var item in DataExfiltrationProtections) { writer.WriteStringValue(item.ToString()); } @@ -170,15 +170,15 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("eTag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(IsUpgradeAvailable)) + if (Optional.IsDefined(IsUpgradeAvailable)) { writer.WritePropertyName("upgradeAvailable"u8); - writer.WriteBooleanValue(IsUpgradeAvailable.Value); + writer.WriteStringValue(IsUpgradeAvailable.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(ServiceUpgradeOn)) + if (options.Format != "W" && Optional.IsDefined(ServiceUpgradedOn)) { - writer.WritePropertyName("serviceUpgradeDate"u8); - writer.WriteStringValue(ServiceUpgradeOn.Value, "O"); + writer.WritePropertyName("serviceUpgradedAt"u8); + writer.WriteStringValue(ServiceUpgradedOn.Value, "O"); } writer.WriteEndObject(); } @@ -221,7 +221,7 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme string statusDetails = default; SearchServiceProvisioningState? provisioningState = default; SearchServiceNetworkRuleSet networkRuleSet = default; - IList disabledDataExfiltrationOptions = default; + IList dataExfiltrationProtections = default; SearchEncryptionWithCmk encryptionWithCmk = default; bool? disableLocalAuth = default; SearchAadAuthDataPlaneAuthOptions authOptions = default; @@ -229,8 +229,8 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme IReadOnlyList privateEndpointConnections = default; IReadOnlyList sharedPrivateLinkResources = default; ETag? eTag = default; - bool? upgradeAvailable = default; - DateTimeOffset? serviceUpgradeDate = default; + UpgradeAvailable? upgradeAvailable = default; + DateTimeOffset? serviceUpgradedAt = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -391,18 +391,18 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme networkRuleSet = SearchServiceNetworkRuleSet.DeserializeSearchServiceNetworkRuleSet(property0.Value, options); continue; } - if (property0.NameEquals("disabledDataExfiltrationOptions"u8)) + if (property0.NameEquals("dataExfiltrationProtections"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - array.Add(new SearchDisabledDataExfiltrationOption(item.GetString())); + array.Add(new SearchDataExfiltrationProtection(item.GetString())); } - disabledDataExfiltrationOptions = array; + dataExfiltrationProtections = array; continue; } if (property0.NameEquals("encryptionWithCmk"u8)) @@ -486,16 +486,16 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme { continue; } - upgradeAvailable = property0.Value.GetBoolean(); + upgradeAvailable = new UpgradeAvailable(property0.Value.GetString()); continue; } - if (property0.NameEquals("serviceUpgradeDate"u8)) + if (property0.NameEquals("serviceUpgradedAt"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - serviceUpgradeDate = property0.Value.GetDateTimeOffset("O"); + serviceUpgradedAt = property0.Value.GetDateTimeOffset("O"); continue; } } @@ -526,7 +526,7 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme statusDetails, provisioningState, networkRuleSet, - disabledDataExfiltrationOptions ?? new ChangeTrackingList(), + dataExfiltrationProtections ?? new ChangeTrackingList(), encryptionWithCmk, disableLocalAuth, authOptions, @@ -535,7 +535,7 @@ internal static SearchServiceData DeserializeSearchServiceData(JsonElement eleme sharedPrivateLinkResources ?? new ChangeTrackingList(), eTag, upgradeAvailable, - serviceUpgradeDate, + serviceUpgradedAt, serializedAdditionalRawData); } @@ -845,21 +845,21 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisabledDataExfiltrationOptions), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DataExfiltrationProtections), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" disabledDataExfiltrationOptions: "); + builder.Append(" dataExfiltrationProtections: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsCollectionDefined(DisabledDataExfiltrationOptions)) + if (Optional.IsCollectionDefined(DataExfiltrationProtections)) { - if (DisabledDataExfiltrationOptions.Any()) + if (DataExfiltrationProtections.Any()) { - builder.Append(" disabledDataExfiltrationOptions: "); + builder.Append(" dataExfiltrationProtections: "); builder.AppendLine("["); - foreach (var item in DisabledDataExfiltrationOptions) + foreach (var item in DataExfiltrationProtections) { builder.AppendLine($" '{item.ToString()}'"); } @@ -1001,23 +1001,22 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) if (Optional.IsDefined(IsUpgradeAvailable)) { builder.Append(" upgradeAvailable: "); - var boolValue = IsUpgradeAvailable.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); + builder.AppendLine($"'{IsUpgradeAvailable.Value.ToString()}'"); } } - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceUpgradeOn), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceUpgradedOn), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" serviceUpgradeDate: "); + builder.Append(" serviceUpgradedAt: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ServiceUpgradeOn)) + if (Optional.IsDefined(ServiceUpgradedOn)) { - builder.Append(" serviceUpgradeDate: "); - var formattedDateTimeString = TypeFormatters.ToString(ServiceUpgradeOn.Value, "o"); + builder.Append(" serviceUpgradedAt: "); + var formattedDateTimeString = TypeFormatters.ToString(ServiceUpgradedOn.Value, "o"); builder.AppendLine($"'{formattedDateTimeString}'"); } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.cs index 1693805beb16..4086ddfeb142 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceData.cs @@ -55,7 +55,7 @@ public partial class SearchServiceData : TrackedResourceData /// The location. public SearchServiceData(AzureLocation location) : base(location) { - DisabledDataExfiltrationOptions = new ChangeTrackingList(); + DataExfiltrationProtections = new ChangeTrackingList(); PrivateEndpointConnections = new ChangeTrackingList(); SharedPrivateLinkResources = new ChangeTrackingList(); } @@ -73,13 +73,13 @@ public SearchServiceData(AzureLocation location) : base(location) /// The number of partitions in the search service; if specified, it can be 1, 2, 3, 4, 6, or 12. Values greater than 1 are only valid for standard SKUs. For 'standard3' services with hostingMode set to 'highDensity', the allowed values are between 1 and 3. /// The endpoint of the Azure AI Search service. /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. /// The status of the search service. Possible values include: 'running': The search service is running and no provisioning operations are underway. 'provisioning': The search service is being provisioned or scaled up or down. 'deleting': The search service is being deleted. 'degraded': The search service is degraded. This can occur when the underlying search units are not healthy. The search service is most likely operational, but performance might be slow and some requests might be dropped. 'disabled': The search service is disabled. In this state, the service will reject all API requests. 'error': The search service is in an error state. 'stopped': The search service is in a subscription that's disabled. If your service is in the degraded, disabled, or error states, it means the Azure AI Search team is actively investigating the underlying issue. Dedicated services in these states are still chargeable based on the number of search units provisioned. /// The details of the search service status. /// The state of the last provisioning operation performed on the search service. Provisioning is an intermediate state that occurs while service capacity is being established. After capacity is set up, provisioningState changes to either 'Succeeded' or 'Failed'. Client applications can poll provisioning status (the recommended polling interval is from 30 seconds to one minute) by using the Get Search Service operation to see when an operation is completed. If you are using the free service, this value tends to come back as 'Succeeded' directly in the call to Create search service. This is because the free service uses capacity that is already set up. /// Network specific rules that determine how the Azure AI Search service may be reached. - /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. + /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. /// When set to true, calls to the search service will not be permitted to utilize API keys for authentication. This cannot be set to true if 'dataPlaneAuthOptions' are defined. /// Defines the options for how the data plane API of a search service authenticates requests. This cannot be set if 'disableLocalAuth' is set to true. @@ -87,10 +87,10 @@ public SearchServiceData(AzureLocation location) : base(location) /// The list of private endpoint connections to the Azure AI Search service. /// The list of shared private link resources managed by the Azure AI Search service. /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. - /// Indicates whether or not the search service has an upgrade available. - /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. + /// Indicates if the search service has an upgrade available. + /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. /// Keeps track of any properties unknown to the library. - internal SearchServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SearchSku searchSku, ManagedServiceIdentity identity, int? replicaCount, int? partitionCount, Uri endpoint, SearchServiceHostingMode? hostingMode, SearchServiceComputeType? computeType, SearchServicePublicInternetAccess? publicInternetAccess, SearchServiceStatus? status, string statusDetails, SearchServiceProvisioningState? provisioningState, SearchServiceNetworkRuleSet networkRuleSet, IList disabledDataExfiltrationOptions, SearchEncryptionWithCmk encryptionWithCmk, bool? isLocalAuthDisabled, SearchAadAuthDataPlaneAuthOptions authOptions, SearchSemanticSearch? semanticSearch, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, ETag? eTag, bool? isUpgradeAvailable, DateTimeOffset? serviceUpgradeOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal SearchServiceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SearchSku searchSku, ManagedServiceIdentity identity, int? replicaCount, int? partitionCount, Uri endpoint, SearchServiceHostingMode? hostingMode, SearchServiceComputeType? computeType, SearchServicePublicInternetAccess? publicInternetAccess, SearchServiceStatus? status, string statusDetails, SearchServiceProvisioningState? provisioningState, SearchServiceNetworkRuleSet networkRuleSet, IList dataExfiltrationProtections, SearchEncryptionWithCmk encryptionWithCmk, bool? isLocalAuthDisabled, SearchAadAuthDataPlaneAuthOptions authOptions, SearchSemanticSearch? semanticSearch, IReadOnlyList privateEndpointConnections, IReadOnlyList sharedPrivateLinkResources, ETag? eTag, UpgradeAvailable? isUpgradeAvailable, DateTimeOffset? serviceUpgradedOn, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { SearchSku = searchSku; Identity = identity; @@ -104,7 +104,7 @@ internal SearchServiceData(ResourceIdentifier id, string name, ResourceType reso StatusDetails = statusDetails; ProvisioningState = provisioningState; NetworkRuleSet = networkRuleSet; - DisabledDataExfiltrationOptions = disabledDataExfiltrationOptions; + DataExfiltrationProtections = dataExfiltrationProtections; EncryptionWithCmk = encryptionWithCmk; IsLocalAuthDisabled = isLocalAuthDisabled; AuthOptions = authOptions; @@ -113,7 +113,7 @@ internal SearchServiceData(ResourceIdentifier id, string name, ResourceType reso SharedPrivateLinkResources = sharedPrivateLinkResources; ETag = eTag; IsUpgradeAvailable = isUpgradeAvailable; - ServiceUpgradeOn = serviceUpgradeOn; + ServiceUpgradedOn = serviceUpgradedOn; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -152,7 +152,7 @@ public SearchServiceSkuName? SearchSkuName /// Applicable only for the standard3 SKU. You can set this property to enable up to 3 high density partitions that allow up to 1000 indexes, which is much higher than the maximum indexes allowed for any other SKU. For the standard3 SKU, the value is either 'default' or 'highDensity'. For all other SKUs, this value must be 'default'. [WirePath("properties.hostingMode")] public SearchServiceHostingMode? HostingMode { get; set; } - /// Configure this property to support the search service using either the default compute or Azure Confidential Compute. + /// Configure this property to support the search service using either the Default Compute or Azure Confidential Compute. [WirePath("properties.computeType")] public SearchServiceComputeType? ComputeType { get; set; } /// This value can be set to 'enabled' to avoid breaking changes on existing customer resources and templates. If set to 'disabled', traffic over public interface is not allowed, and private endpoint connections would be the exclusive access method. @@ -171,8 +171,8 @@ public SearchServiceSkuName? SearchSkuName [WirePath("properties.networkRuleSet")] public SearchServiceNetworkRuleSet NetworkRuleSet { get; set; } /// A list of data exfiltration scenarios that are explicitly disallowed for the search service. Currently, the only supported value is 'All' to disable all possible data export scenarios with more fine grained controls planned for the future. - [WirePath("properties.disabledDataExfiltrationOptions")] - public IList DisabledDataExfiltrationOptions { get; } + [WirePath("properties.dataExfiltrationProtections")] + public IList DataExfiltrationProtections { get; } /// Specifies any policy regarding encryption of resources (such as indexes) using customer manager keys within a search service. [WirePath("properties.encryptionWithCmk")] public SearchEncryptionWithCmk EncryptionWithCmk { get; set; } @@ -194,11 +194,11 @@ public SearchServiceSkuName? SearchSkuName /// A system generated property representing the service's etag that can be for optimistic concurrency control during updates. [WirePath("properties.eTag")] public ETag? ETag { get; } - /// Indicates whether or not the search service has an upgrade available. + /// Indicates if the search service has an upgrade available. [WirePath("properties.upgradeAvailable")] - public bool? IsUpgradeAvailable { get; } + public UpgradeAvailable? IsUpgradeAvailable { get; set; } /// The date and time the search service was last upgraded. This field will be null until the service gets upgraded for the first time. - [WirePath("properties.serviceUpgradeDate")] - public DateTimeOffset? ServiceUpgradeOn { get; } + [WirePath("properties.serviceUpgradedAt")] + public DateTimeOffset? ServiceUpgradedOn { get; } } } diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs index 85e8683dbfc5..09ed55ba5cc0 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SearchServiceResource.cs @@ -44,8 +44,6 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly QueryKeysRestOperations _queryKeysRestClient; private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics; private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient; - private readonly ClientDiagnostics _serviceClientDiagnostics; - private readonly ServiceRestOperations _serviceRestClient; private readonly SearchServiceData _data; /// Gets the resource type for the operations. @@ -79,8 +77,6 @@ internal SearchServiceResource(ArmClient client, ResourceIdentifier id) : base(c _queryKeysRestClient = new QueryKeysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Search", ProviderConstants.DefaultProviderNamespace, Diagnostics); _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _serviceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Search", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _serviceRestClient = new ServiceRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -127,7 +123,7 @@ public virtual SearchPrivateEndpointConnectionCollection GetSearchPrivateEndpoin /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -159,7 +155,7 @@ public virtual async Task> Get /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -198,7 +194,7 @@ public virtual SharedSearchServicePrivateLinkResourceCollection GetSharedSearchS /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -230,7 +226,7 @@ public virtual async Task> GetS /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -269,7 +265,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -277,7 +273,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -300,7 +296,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -308,7 +304,7 @@ public virtual async Task /// /// - /// The network security configuration name. + /// The network security perimeter configuration name. /// The cancellation token to use. /// is null. /// is an empty string, and was expected to be non-empty. @@ -331,7 +327,7 @@ public virtual Response GetNetwor /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -372,7 +368,7 @@ public virtual async Task> GetAsync(SearchManage /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -413,7 +409,7 @@ public virtual Response Get(SearchManagementRequestOption /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -458,7 +454,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, SearchM /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -503,7 +499,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, SearchManagementRequestO /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -546,7 +542,7 @@ public virtual async Task> UpdateAsync(SearchSer /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -589,7 +585,7 @@ public virtual Response Update(SearchServicePatch patch, /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -624,7 +620,7 @@ public virtual async Task> GetAdminKeyAsyn /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -659,7 +655,7 @@ public virtual Response GetAdminKey(SearchManagemen /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -695,7 +691,7 @@ public virtual async Task> RegenerateAdmin /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -731,7 +727,7 @@ public virtual Response RegenerateAdminKey(SearchSe /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -771,7 +767,7 @@ public virtual async Task> CreateQueryKeyAsync(s /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -811,7 +807,7 @@ public virtual Response CreateQueryKey(string name, Searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -838,7 +834,7 @@ public virtual AsyncPageable GetQueryKeysBySearchServiceA /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -865,7 +861,7 @@ public virtual Pageable GetQueryKeysBySearchService(Searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -905,7 +901,7 @@ public virtual async Task DeleteQueryKeyAsync(string key, SearchManage /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// @@ -933,131 +929,139 @@ public virtual Response DeleteQueryKey(string key, SearchManagementRequestOption } /// - /// Gets a list of all supported private link resource types for the given service. + /// Upgrades the Azure AI Search service to the latest version available. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/upgrade /// /// /// Operation Id - /// PrivateLinkResources_ListSupported + /// Services_Upgrade /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 + /// + /// + /// Resource + /// /// /// /// - /// Parameter group. + /// 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. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetSupportedPrivateLinkResourcesAsync(SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) + public virtual async Task> UpgradeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListSupportedRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, searchManagementRequestOptions); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SearchPrivateLinkResource.DeserializeSearchPrivateLinkResource(e), _privateLinkResourcesClientDiagnostics, Pipeline, "SearchServiceResource.GetSupportedPrivateLinkResources", "value", null, cancellationToken); + using var scope = _searchServiceServicesClientDiagnostics.CreateScope("SearchServiceResource.Upgrade"); + scope.Start(); + try + { + var response = await _searchServiceServicesRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SearchArmOperation(new SearchServiceOperationSource(Client), _searchServiceServicesClientDiagnostics, Pipeline, _searchServiceServicesRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Gets a list of all supported private link resource types for the given service. + /// Upgrades the Azure AI Search service to the latest version available. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/upgrade /// /// /// Operation Id - /// PrivateLinkResources_ListSupported + /// Services_Upgrade /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 + /// + /// + /// Resource + /// /// /// /// - /// Parameter group. + /// 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. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetSupportedPrivateLinkResources(SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) + public virtual ArmOperation Upgrade(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListSupportedRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, searchManagementRequestOptions); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SearchPrivateLinkResource.DeserializeSearchPrivateLinkResource(e), _privateLinkResourcesClientDiagnostics, Pipeline, "SearchServiceResource.GetSupportedPrivateLinkResources", "value", null, cancellationToken); + using var scope = _searchServiceServicesClientDiagnostics.CreateScope("SearchServiceResource.Upgrade"); + scope.Start(); + try + { + var response = _searchServiceServicesRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SearchArmOperation(new SearchServiceOperationSource(Client), _searchServiceServicesClientDiagnostics, Pipeline, _searchServiceServicesRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Upgrades the Azure AI Search service to the latest version available. + /// Gets a list of all supported private link resource types for the given service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/upgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources /// /// /// Operation Id - /// Service_Upgrade + /// PrivateLinkResources_ListSupported /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// - /// 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. + /// Parameter group. /// The cancellation token to use. - public virtual async Task> UpgradeServiceAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSupportedPrivateLinkResourcesAsync(SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - using var scope = _serviceClientDiagnostics.CreateScope("SearchServiceResource.UpgradeService"); - scope.Start(); - try - { - var response = await _serviceRestClient.UpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new SearchArmOperation(new SearchServiceOperationSource(Client), _serviceClientDiagnostics, Pipeline, _serviceRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListSupportedRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, searchManagementRequestOptions); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => SearchPrivateLinkResource.DeserializeSearchPrivateLinkResource(e), _privateLinkResourcesClientDiagnostics, Pipeline, "SearchServiceResource.GetSupportedPrivateLinkResources", "value", null, cancellationToken); } /// - /// Upgrades the Azure AI Search service to the latest version available. + /// Gets a list of all supported private link resource types for the given service. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/upgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Search/searchServices/{searchServiceName}/privateLinkResources /// /// /// Operation Id - /// Service_Upgrade + /// PrivateLinkResources_ListSupported /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// - /// 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. + /// Parameter group. /// The cancellation token to use. - public virtual ArmOperation UpgradeService(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSupportedPrivateLinkResources(SearchManagementRequestOptions searchManagementRequestOptions = null, CancellationToken cancellationToken = default) { - using var scope = _serviceClientDiagnostics.CreateScope("SearchServiceResource.UpgradeService"); - scope.Start(); - try - { - var response = _serviceRestClient.Upgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new SearchArmOperation(new SearchServiceOperationSource(Client), _serviceClientDiagnostics, Pipeline, _serviceRestClient.CreateUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } + HttpMessage FirstPageRequest(int? pageSizeHint) => _privateLinkResourcesRestClient.CreateListSupportedRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, searchManagementRequestOptions); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => SearchPrivateLinkResource.DeserializeSearchPrivateLinkResource(e), _privateLinkResourcesClientDiagnostics, Pipeline, "SearchServiceResource.GetSupportedPrivateLinkResources", "value", null, cancellationToken); } /// @@ -1073,7 +1077,7 @@ public virtual ArmOperation UpgradeService(WaitUntil wait /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -1135,7 +1139,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -1197,7 +1201,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -1254,7 +1258,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -1311,7 +1315,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -1371,7 +1375,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResource.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResource.cs index a45f98017bb4..11f534c20214 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResource.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(SearchManage /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, SearchM /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, SearchManagementRequestO /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResourceCollection.cs b/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResourceCollection.cs index e5b53686ff10..ea45d1af945b 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResourceCollection.cs +++ b/sdk/search/Azure.ResourceManager.Search/src/Generated/SharedSearchServicePrivateLinkResourceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -165,7 +165,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string share /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -288,7 +288,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -319,7 +319,7 @@ public virtual Pageable GetAll(SearchMan /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -363,7 +363,7 @@ public virtual async Task> ExistsAsync(string sharedPrivateLinkRe /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -407,7 +407,7 @@ public virtual Response Exists(string sharedPrivateLinkResourceName, Searc /// /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource @@ -453,7 +453,7 @@ public virtual async Task /// /// Default Api Version - /// 2025-02-01-preview + /// 2025-05-01 /// /// /// Resource diff --git a/sdk/search/Azure.ResourceManager.Search/src/autorest.md b/sdk/search/Azure.ResourceManager.Search/src/autorest.md index 2174d6918074..2ef767be0ae4 100644 --- a/sdk/search/Azure.ResourceManager.Search/src/autorest.md +++ b/sdk/search/Azure.ResourceManager.Search/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Search namespace: Azure.ResourceManager.Search -require: https://github.com/Azure/azure-rest-api-specs/blob/2aaa7ef3c48b8f4b7cb0e1e9bbe0041eec62c92d/specification/search/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/search/resource-manager/readme.md #tag: package-preview-2025-02 output-folder: $(this-folder)/Generated clear-output-folder: true diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..4e749e6b85b1 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -12,6 +12,8 @@ trigger: - sdk/storage/Azure.Storage.DataMovement/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ - sdk/storage/Azure.Storage.DataMovement.Files/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/ exclude: - sdk/storage/Azure.ResourceManager.Storage/