Skip to content

Commit 6f896e2

Browse files
committed
Migrate RedisEnterpriseCache module to autorest v4
1 parent 231129f commit 6f896e2

File tree

81 files changed

+7978
-4641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+7978
-4641
lines changed

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/Properties/AssemblyInfo.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
2121
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
2222
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - RedisEnterpriseCache")]
23-
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.4.1")]
24-
[assembly: System.Reflection.AssemblyVersionAttribute("1.4.1")]
23+
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.5.0")]
24+
[assembly: System.Reflection.AssemblyVersionAttribute("1.5.0")]
2525
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
2626
[assembly: System.CLSCompliantAttribute(false)]
27+

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/README.md

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,24 @@ module-version: 1.0.0
4343
title: RedisEnterpriseCache
4444
subject-prefix: 'RedisEnterpriseCache'
4545

46-
# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
47-
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
48-
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
49-
use-extension:
50-
"@autorest/powershell": "3.x"
51-
5246
directive:
47+
- from: swagger-document
48+
where: $.definitions.AccessPolicyAssignment
49+
transform: $['required'] = ['properties']
50+
- from: swagger-document
51+
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
52+
transform: $['required'] = ['objectId']
53+
- from: swagger-document
54+
where: $.definitions.ForceLinkParameters.properties.geoReplication
55+
transform: $['required'] = ['linkedDatabases','groupNickname']
56+
57+
- from: swagger-document
58+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
59+
transform: $['operationId'] = 'AccessPolicyAssignment_CreateOrUpdate'
60+
- from: swagger-document
61+
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
62+
transform: $['description'] = 'Create a particular access policy assignment for a database'
63+
5364
# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
5465
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
5566
- where:
@@ -80,11 +91,6 @@ directive:
8091
alias:
8192
- Get-AzRedisEnterpriseCacheDatabaseKey
8293
- Get-AzRedisEnterpriseCacheAccessKey
83-
- where:
84-
verb: New
85-
subject: AccessPolicyAssignmentUpdate
86-
set:
87-
subject: AccessPolicyAssignment
8894
- where:
8995
verb: Import|Export
9096
subject: (^Database)(.*)
@@ -208,15 +214,24 @@ directive:
208214
subject: Key
209215
variant: ^Regenerate$|ViaIdentity
210216
remove: true
217+
218+
# Remove unexpanded variant
211219
- where:
212-
verb: New
213-
subject: ^$|Database
214-
variant: ^Create$|ViaIdentity
220+
verb: Invoke
221+
variant: ^(Flush|Force)(?!.*?(Expanded|JsonFilePath|JsonString))
215222
remove: true
216223
- where:
217-
verb: Update
218224
subject: ^$|Database
219-
variant: ^Update$|ViaIdentity$
225+
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
226+
remove: true
227+
- where:
228+
subject: AccessPolicyAssignment
229+
variant: ^(Create)(?!.*?(Expanded|JsonFilePath|JsonString))
230+
remove: true
231+
# Remove because cannot update
232+
- where:
233+
verb: Set|Update
234+
subject: AccessPolicyAssignment
220235
remove: true
221236

222237
# Hide cmdlets
@@ -244,17 +259,6 @@ directive:
244259
set:
245260
default:
246261
script: '"default"'
247-
248-
- from: swagger-document
249-
where: $.definitions.AccessPolicyAssignment
250-
transform: $['required'] = ['properties']
251-
- from: swagger-document
252-
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
253-
transform: $['required'] = ['objectId']
254-
- from: swagger-document
255-
where: $.definitions.ForceLinkParameters.properties.geoReplication
256-
transform: $['required'] = ['linkedDatabases','groupNickname']
257-
258262
# DatabaseName parameter to have value 'default'
259263
- where:
260264
verb: Invoke
@@ -265,9 +269,9 @@ directive:
265269
default:
266270
script: '"default"'
267271
# Fix bugs in generated code from namespace conflict
268-
- from: source-file-csharp
269-
where: $
270-
transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
272+
# - from: source-file-csharp
273+
# where: $
274+
# transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
271275
- from: source-file-csharp
272276
where: $
273277
transform: $ = $.replace(/Module.Instance.SetProxyConfiguration\(/g, 'Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Module.Instance.SetProxyConfiguration(');

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/custom/Cluster.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See License.txt in the project root for license information.
33

4-
namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview
4+
namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models
55
{
66
public partial class Cluster
77
{

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/custom/Get-AzRedisEnterpriseCache.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ West US MyCache3 Microsoft.Cache/redisEnterprise {default}
4444
Central US MyCache4 Microsoft.Cache/redisEnterprise {1, 2, 3} {default}
4545
4646
.Outputs
47-
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.ICluster
47+
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster
4848
.Link
4949
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecache
5050
#>
5151

5252
function Get-AzRedisEnterpriseCache {
53-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.ICluster])]
53+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster])]
5454
[CmdletBinding(DefaultParameterSetName='ListBySubscriptionId', PositionalBinding=$false)]
5555
param(
5656
[Parameter(ParameterSetName='Get', Mandatory)]

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/custom/Get-AzRedisEnterpriseCacheDatabase.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ Name Type
2626
default Microsoft.Cache/redisEnterprise/databases
2727
2828
.Outputs
29-
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IDatabase
29+
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase
3030
.Link
3131
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachedatabase
3232
#>
3333
function Get-AzRedisEnterpriseCacheDatabase {
34-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IDatabase])]
34+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase])]
3535
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
3636
param(
3737
[Parameter(Mandatory)]

src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/custom/Get-AzRedisEnterpriseCacheKey.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ PrimaryKey SecondaryKey
2626
primary-key secondary-key
2727
2828
.Outputs
29-
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IAccessKeys
29+
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys
3030
.Link
3131
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachekey
3232
#>
3333
function Get-AzRedisEnterpriseCacheKey {
3434
[Alias('Get-AzRedisEnterpriseCacheDatabaseKey', 'Get-AzRedisEnterpriseCacheAccessKey')]
35-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IAccessKeys])]
35+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys])]
3636
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
3737
param(
3838
[Parameter(Mandatory)]

0 commit comments

Comments
 (0)