Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - RedisEnterpriseCache")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.5.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.5.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.6.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.6.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
64 changes: 35 additions & 29 deletions src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,23 @@ module-version: 1.0.0
title: RedisEnterpriseCache
subject-prefix: 'RedisEnterpriseCache'

# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']

- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['operationId'] = 'AccessPolicyAssignment_CreateOrUpdate'
Comment on lines 46 to +59
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Several newly added AutoRest README directives are missing explanatory comments. Per repo guidance, each directive should have a brief comment explaining the purpose/why, so future maintainers can safely update/remove them.

Suggested change
directive:
- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['operationId'] = 'AccessPolicyAssignment_CreateOrUpdate'
directive:
# Mark the properties bag as required so generated create/update cmdlets enforce the payload shape expected by the service.
- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
# Require objectId on the nested user object to prevent generating an incomplete access policy assignment request.
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
# Require geo-replication linkage fields together so ForceLink requests include the minimum data the API needs.
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']
# Override the generated operationId to produce a stable and user-friendly cmdlet name for access policy assignment upsert.
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['operationId'] = 'AccessPolicyAssignment_CreateOrUpdate'
# Provide a clearer operation description so generated help text explains that this PUT both creates and updates assignments.

Copilot uses AI. Check for mistakes.
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['description'] = 'Creates/Updates a particular access policy assignment for a database'
# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
- where:
Expand Down Expand Up @@ -80,11 +90,6 @@ directive:
alias:
- Get-AzRedisEnterpriseCacheDatabaseKey
- Get-AzRedisEnterpriseCacheAccessKey
- where:
verb: New
subject: AccessPolicyAssignmentUpdate
set:
subject: AccessPolicyAssignment
- where:
verb: Import|Export
subject: (^Database)(.*)
Expand Down Expand Up @@ -208,15 +213,24 @@ directive:
subject: Key
variant: ^Regenerate$|ViaIdentity
remove: true

# Remove unexpanded variant
- where:
verb: New
subject: ^$|Database
variant: ^Create$|ViaIdentity
verb: Invoke
variant: ^(Flush|Force)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
verb: Update
subject: ^$|Database
variant: ^Update$|ViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
subject: AccessPolicyAssignment
variant: ^(Create)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
# Remove because cannot update
- where:
verb: Set|Update
subject: AccessPolicyAssignment
remove: true

# Hide cmdlets
Expand Down Expand Up @@ -244,17 +258,6 @@ directive:
set:
default:
script: '"default"'

- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']

# DatabaseName parameter to have value 'default'
- where:
verb: Invoke
Expand All @@ -275,12 +278,15 @@ directive:
estimated-ga-date: 2025/11/19

# Fix bugs in generated code from namespace conflict
# - from: source-file-csharp
# where: $
# transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
- from: source-file-csharp
where: $
transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
transform: $ = $.replace(/Module.Instance.SetProxyConfiguration\(/g, 'Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Module.Instance.SetProxyConfiguration(');
- from: source-file-csharp
where: $
transform: $ = $.replace(/Module.Instance.SetProxyConfiguration\(/g, 'Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Module.Instance.SetProxyConfiguration(');
transform: $ = $.replace(/Forcibly reforce an existing database/g, 'Forcibly recreates an existing database');

# Breaking change
- where:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701
namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models
{
public partial class Cluster
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ West US MyCache3 Microsoft.Cache/redisEnterprise {default}
Central US MyCache4 Microsoft.Cache/redisEnterprise {1, 2, 3} {default}

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.ICluster
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecache
#>
Expand All @@ -55,7 +55,7 @@ function Get-AzRedisEnterpriseCache {
* At least one change applies to this cmdlet. *`n
* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *`n
***************************************************************************************************")]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.ICluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster])]
[CmdletBinding(DefaultParameterSetName='ListBySubscriptionId', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Name Type
default Microsoft.Cache/redisEnterprise/databases

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.IDatabase
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachedatabase
#>
Expand All @@ -36,7 +36,7 @@ function Get-AzRedisEnterpriseCacheDatabase {
* At least one change applies to this cmdlet. *`n
* See all possible breaking changes at https://go.microsoft.com/fwlink/?linkid=2333486 *`n
***************************************************************************************************")]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.IDatabase])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ PrimaryKey SecondaryKey
primary-key secondary-key

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.IAccessKeys
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachekey
#>
function Get-AzRedisEnterpriseCacheKey {
[Alias('Get-AzRedisEnterpriseCacheDatabaseKey', 'Get-AzRedisEnterpriseCacheAccessKey')]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250701.IAccessKeys])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand Down
Loading