diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0327cede92f1..fc149bd6fb43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25273,49 +25273,52 @@ importers: sdk/redis/arm-rediscache: dependencies: + '@azure-rest/core-client': + specifier: ^2.3.1 + version: link:../../core/core-client-rest '@azure/abort-controller': specifier: ^2.1.2 version: link:../../core/abort-controller '@azure/core-auth': specifier: ^1.9.0 version: link:../../core/core-auth - '@azure/core-client': - specifier: ^1.9.2 - version: link:../../core/core-client '@azure/core-lro': - specifier: ^2.5.4 - version: 2.7.2 - '@azure/core-paging': - specifier: ^1.6.2 - version: link:../../core/core-paging + specifier: ^3.1.0 + version: link:../../core/core-lro '@azure/core-rest-pipeline': - specifier: ^1.19.0 + specifier: ^1.20.0 version: link:../../core/core-rest-pipeline + '@azure/core-util': + specifier: ^1.12.0 + version: link:../../core/core-util + '@azure/logger': + specifier: ^1.2.0 + version: link:../../core/logger tslib: specifier: ^2.8.1 version: 2.8.1 devDependencies: '@azure-tools/test-credential': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/test-credential '@azure-tools/test-recorder': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/recorder '@azure-tools/test-utils-vitest': - specifier: workspace:^ + specifier: workspace:* version: link:../../test-utils/test-utils-vitest '@azure/arm-network': specifier: ^32.2.0 version: 32.2.0 '@azure/dev-tool': - specifier: workspace:^ + specifier: workspace:* version: link:../../../common/tools/dev-tool + '@azure/eslint-plugin-azure-sdk': + specifier: workspace:* + version: link:../../../common/tools/eslint-plugin-azure-sdk '@azure/identity': specifier: catalog:internal version: 4.11.1 - '@azure/logger': - specifier: ^1.1.4 - version: link:../../core/logger '@types/node': specifier: 'catalog:' version: 20.19.23 @@ -25331,9 +25334,15 @@ importers: dotenv: specifier: catalog:testing version: 16.6.1 + eslint: + specifier: 'catalog:' + version: 9.38.0 playwright: specifier: catalog:testing version: 1.56.1 + prettier: + specifier: 'catalog:' + version: 3.6.2 rimraf: specifier: 'catalog:' version: 6.0.1 diff --git a/sdk/redis/arm-rediscache/CHANGELOG.md b/sdk/redis/arm-rediscache/CHANGELOG.md index b9d02d51e41f..2d705ddb984f 100644 --- a/sdk/redis/arm-rediscache/CHANGELOG.md +++ b/sdk/redis/arm-rediscache/CHANGELOG.md @@ -1,21 +1,177 @@ # Release History -## 8.2.2 (Unreleased) +## 9.0.0 (2025-10-28) ### Features Added + - Added operation AccessPolicyOperations.createUpdate + - Added operation AccessPolicyOperations.delete + - Added operation AccessPolicyAssignmentOperations.createUpdate + - Added operation AccessPolicyAssignmentOperations.delete + - Added operation LinkedServerOperations.create + - Added operation LinkedServerOperations.delete + - Added operation PrivateEndpointConnectionsOperations.put + - Added operation RedisOperations.create + - Added operation RedisOperations.delete + - Added operation RedisOperations.exportData + - Added operation RedisOperations.flushCache + - Added operation RedisOperations.importData + - Added operation RedisOperations.update + - Added Interface PagedAsyncIterableIterator + - Added Interface PageSettings + - Added Interface PrivateEndpointConnectionProperties + - Added Interface PrivateLinkResourceProperties + - Added Interface RedisCacheAccessPolicyAssignmentProperties + - Added Interface RedisCacheAccessPolicyProperties + - Added Interface RedisFirewallRuleProperties + - Added Interface RestorePollerOptions + - Added Interface ScheduleEntries + - Added Interface SystemData + - Interface PrivateEndpointConnection has a new optional parameter properties + - Interface PrivateEndpointConnection has a new optional parameter systemData + - Interface PrivateLinkResource has a new optional parameter properties + - Interface PrivateLinkResource has a new optional parameter systemData + - Interface ProxyResource has a new optional parameter systemData + - Interface RedisCacheAccessPolicy has a new optional parameter properties + - Interface RedisCacheAccessPolicy has a new optional parameter systemData + - Interface RedisCacheAccessPolicyAssignment has a new optional parameter properties + - Interface RedisCacheAccessPolicyAssignment has a new optional parameter systemData + - Interface RedisCommonPropertiesRedisConfiguration has a new optional parameter additionalProperties + - Interface RedisFirewallRule has a new optional parameter systemData + - Interface RedisLinkedServerWithProperties has a new optional parameter properties + - Interface RedisLinkedServerWithProperties has a new optional parameter systemData + - Interface RedisPatchSchedule has a new optional parameter systemData + - Interface RedisResource has a new optional parameter systemData + - Interface RedisUpdateParameters has a new optional parameter properties + - Interface Resource has a new optional parameter systemData + - Interface TrackedResource has a new optional parameter systemData + - Added Type Alias AzureSupportedClouds + - Added Type Alias CreatedByType + - Added Enum AzureClouds + - Added Enum KnownCreatedByType + - Added Enum KnownVersions ### Breaking Changes + - Removed operation AccessPolicy.beginCreateUpdate + - Removed operation AccessPolicy.beginCreateUpdateAndWait + - Removed operation AccessPolicy.beginDelete + - Removed operation AccessPolicy.beginDeleteAndWait + - Removed operation AccessPolicyAssignment.beginCreateUpdate + - Removed operation AccessPolicyAssignment.beginCreateUpdateAndWait + - Removed operation AccessPolicyAssignment.beginDelete + - Removed operation AccessPolicyAssignment.beginDeleteAndWait + - Removed operation LinkedServer.beginCreate + - Removed operation LinkedServer.beginCreateAndWait + - Removed operation LinkedServer.beginDelete + - Removed operation LinkedServer.beginDeleteAndWait + - Removed operation PrivateEndpointConnections.beginPut + - Removed operation PrivateEndpointConnections.beginPutAndWait + - Removed operation Redis.beginCreate + - Removed operation Redis.beginCreateAndWait + - Removed operation Redis.beginDelete + - Removed operation Redis.beginDeleteAndWait + - Removed operation Redis.beginExportData + - Removed operation Redis.beginExportDataAndWait + - Removed operation Redis.beginFlushCache + - Removed operation Redis.beginFlushCacheAndWait + - Removed operation Redis.beginImportData + - Removed operation Redis.beginImportDataAndWait + - Removed operation Redis.beginUpdate + - Removed operation Redis.beginUpdateAndWait + - Operation FirewallRules.createOrUpdate has a new signature + - Operation FirewallRules.get has a new signature + - Operation PatchSchedules.createOrUpdate has a new signature + - Operation PatchSchedules.get has a new signature + - Operation Redis.get has a new signature + - Removed Interface NotificationListResponse + - Removed Interface RedisCacheAccessPolicyAssignmentList + - Removed Interface RedisCacheAccessPolicyList + - Removed Interface RedisFirewallRuleCreateParameters + - Removed Interface RedisLinkedServerWithPropertiesList + - Interface RedisCreateParameters has a new required parameter properties + - Interface RedisFirewallRule has a new required parameter properties + - Interface RedisLinkedServerCreateParameters has a new required parameter properties + - Interface RedisPatchSchedule has a new required parameter properties + - Interface RedisResource has a new required parameter properties + - Interface PrivateEndpointConnection no longer has parameter privateEndpoint + - Interface PrivateEndpointConnection no longer has parameter privateLinkServiceConnectionState + - Interface PrivateEndpointConnection no longer has parameter provisioningState + - Interface PrivateLinkResource no longer has parameter groupId + - Interface PrivateLinkResource no longer has parameter requiredMembers + - Interface PrivateLinkResource no longer has parameter requiredZoneNames + - Interface RedisCacheAccessPolicy no longer has parameter permissions + - Interface RedisCacheAccessPolicy no longer has parameter provisioningState + - Interface RedisCacheAccessPolicy no longer has parameter typePropertiesType + - Interface RedisCacheAccessPolicyAssignment no longer has parameter accessPolicyName + - Interface RedisCacheAccessPolicyAssignment no longer has parameter objectId + - Interface RedisCacheAccessPolicyAssignment no longer has parameter objectIdAlias + - Interface RedisCacheAccessPolicyAssignment no longer has parameter provisioningState + - Interface RedisCreateParameters no longer has parameter disableAccessKeyAuthentication + - Interface RedisCreateParameters no longer has parameter enableNonSslPort + - Interface RedisCreateParameters no longer has parameter minimumTlsVersion + - Interface RedisCreateParameters no longer has parameter publicNetworkAccess + - Interface RedisCreateParameters no longer has parameter redisConfiguration + - Interface RedisCreateParameters no longer has parameter redisVersion + - Interface RedisCreateParameters no longer has parameter replicasPerMaster + - Interface RedisCreateParameters no longer has parameter replicasPerPrimary + - Interface RedisCreateParameters no longer has parameter shardCount + - Interface RedisCreateParameters no longer has parameter sku + - Interface RedisCreateParameters no longer has parameter staticIP + - Interface RedisCreateParameters no longer has parameter subnetId + - Interface RedisCreateParameters no longer has parameter tenantSettings + - Interface RedisCreateParameters no longer has parameter updateChannel + - Interface RedisCreateParameters no longer has parameter zonalAllocationPolicy + - Interface RedisFirewallRule no longer has parameter endIP + - Interface RedisFirewallRule no longer has parameter startIP + - Interface RedisLinkedServerCreateParameters no longer has parameter geoReplicatedPrimaryHostName + - Interface RedisLinkedServerCreateParameters no longer has parameter linkedRedisCacheId + - Interface RedisLinkedServerCreateParameters no longer has parameter linkedRedisCacheLocation + - Interface RedisLinkedServerCreateParameters no longer has parameter primaryHostName + - Interface RedisLinkedServerCreateParameters no longer has parameter serverRole + - Interface RedisLinkedServerWithProperties no longer has parameter geoReplicatedPrimaryHostName + - Interface RedisLinkedServerWithProperties no longer has parameter linkedRedisCacheId + - Interface RedisLinkedServerWithProperties no longer has parameter linkedRedisCacheLocation + - Interface RedisLinkedServerWithProperties no longer has parameter primaryHostName + - Interface RedisLinkedServerWithProperties no longer has parameter provisioningState + - Interface RedisLinkedServerWithProperties no longer has parameter serverRole + - Interface RedisPatchSchedule no longer has parameter scheduleEntries + - Interface RedisResource no longer has parameter accessKeys + - Interface RedisResource no longer has parameter disableAccessKeyAuthentication + - Interface RedisResource no longer has parameter enableNonSslPort + - Interface RedisResource no longer has parameter hostName + - Interface RedisResource no longer has parameter instances + - Interface RedisResource no longer has parameter linkedServers + - Interface RedisResource no longer has parameter minimumTlsVersion + - Interface RedisResource no longer has parameter port + - Interface RedisResource no longer has parameter privateEndpointConnections + - Interface RedisResource no longer has parameter provisioningState + - Interface RedisResource no longer has parameter publicNetworkAccess + - Interface RedisResource no longer has parameter redisConfiguration + - Interface RedisResource no longer has parameter redisVersion + - Interface RedisResource no longer has parameter replicasPerMaster + - Interface RedisResource no longer has parameter replicasPerPrimary + - Interface RedisResource no longer has parameter shardCount + - Interface RedisResource no longer has parameter sku + - Interface RedisResource no longer has parameter sslPort + - Interface RedisResource no longer has parameter staticIP + - Interface RedisResource no longer has parameter subnetId + - Interface RedisResource no longer has parameter tenantSettings + - Interface RedisResource no longer has parameter updateChannel + - Interface RedisResource no longer has parameter zonalAllocationPolicy + - Interface RedisUpdateParameters no longer has parameter disableAccessKeyAuthentication + - Interface RedisUpdateParameters no longer has parameter enableNonSslPort + - Interface RedisUpdateParameters no longer has parameter minimumTlsVersion + - Interface RedisUpdateParameters no longer has parameter publicNetworkAccess + - Interface RedisUpdateParameters no longer has parameter redisConfiguration + - Interface RedisUpdateParameters no longer has parameter redisVersion + - Interface RedisUpdateParameters no longer has parameter replicasPerMaster + - Interface RedisUpdateParameters no longer has parameter replicasPerPrimary + - Interface RedisUpdateParameters no longer has parameter shardCount + - Interface RedisUpdateParameters no longer has parameter sku + - Interface RedisUpdateParameters no longer has parameter tenantSettings + - Interface RedisUpdateParameters no longer has parameter updateChannel + - Interface RedisUpdateParameters no longer has parameter zonalAllocationPolicy -### Bugs Fixed - -### Other Changes - -## 8.2.1 (2025-08-22) - -### Other Changes - - - Other fixes - + ## 8.2.0 (2025-01-07) ### Features Added diff --git a/sdk/redis/arm-rediscache/LICENSE b/sdk/redis/arm-rediscache/LICENSE index b2f52a2bad4e..63447fd8bbbf 100644 --- a/sdk/redis/arm-rediscache/LICENSE +++ b/sdk/redis/arm-rediscache/LICENSE @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +SOFTWARE. \ No newline at end of file diff --git a/sdk/redis/arm-rediscache/README.md b/sdk/redis/arm-rediscache/README.md index 331faaf35641..21e1d6f7da83 100644 --- a/sdk/redis/arm-rediscache/README.md +++ b/sdk/redis/arm-rediscache/README.md @@ -4,10 +4,12 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f REST API for Azure Redis Cache Service. -[Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache) | -[Package (NPM)](https://www.npmjs.com/package/@azure/arm-rediscache) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-rediscache) | -[Samples](https://github.com/Azure-Samples/azure-samples-js-management) +Key links: + +- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache) +- [Package (NPM)](https://www.npmjs.com/package/@azure/arm-rediscache) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview) +- [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/samples) ## Getting started @@ -63,16 +65,16 @@ For browser environments, use the `InteractiveBrowserCredential` from the `@azur import { InteractiveBrowserCredential } from "@azure/identity"; import { RedisManagementClient } from "@azure/arm-rediscache"; -const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); +const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -97,7 +99,7 @@ For more detailed instructions on how to enable logs, you can look at the [@azur ## Next steps -Please take a look at the [samples](https://github.com/Azure-Samples/azure-samples-js-management) directory for detailed examples on how to use this library. +Please take a look at the [samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/samples) directory for detailed examples on how to use this library. ## Contributing @@ -107,8 +109,6 @@ If you'd like to contribute to this library, please read the [contributing guide - [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js) -[azure_cli]: https://learn.microsoft.com/cli/azure -[azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com [azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity diff --git a/sdk/redis/arm-rediscache/_meta.json b/sdk/redis/arm-rediscache/_meta.json deleted file mode 100644 index 2cf1fbe2bfed..000000000000 --- a/sdk/redis/arm-rediscache/_meta.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "commit": "10925e3dec73699b950f256576cd6983947faaa3", - "readme": "specification/redis/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\redis\\resource-manager\\readme.md --use=@autorest/typescript@6.0.29 --generate-sample=true", - "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", - "use": "@autorest/typescript@6.0.29" -} diff --git a/sdk/redis/arm-rediscache/api-extractor.json b/sdk/redis/arm-rediscache/api-extractor.json index 16d81e2eb512..870d6d399477 100644 --- a/sdk/redis/arm-rediscache/api-extractor.json +++ b/sdk/redis/arm-rediscache/api-extractor.json @@ -1,3 +1 @@ -{ - "extends": "../../../api-extractor-base.json" -} +{ "extends": "../../../api-extractor-base.json" } diff --git a/sdk/redis/arm-rediscache/eslint.config.mjs b/sdk/redis/arm-rediscache/eslint.config.mjs new file mode 100644 index 000000000000..6d2f8a5914c3 --- /dev/null +++ b/sdk/redis/arm-rediscache/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default azsdkEslint.config([ + { + rules: { + "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-package-json-types": "warn", + "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-files-required": "off", + "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", + "tsdoc/syntax": "warn", + }, + }, +]); diff --git a/sdk/redis/arm-rediscache/metadata.json b/sdk/redis/arm-rediscache/metadata.json new file mode 100644 index 000000000000..323876a8e49a --- /dev/null +++ b/sdk/redis/arm-rediscache/metadata.json @@ -0,0 +1,133 @@ +{ + "apiVersion": "2024-11-01", + "emitterVersion": "0.45.1", + "crossLanguageDefinitions": { + "CrossLanguagePackageId": "Microsoft.Cache", + "CrossLanguageDefinitionId": { + "@azure/arm-rediscache!OperationListResult:interface": "Microsoft.Cache.OperationListResult", + "@azure/arm-rediscache!Operation:interface": "Microsoft.Cache.Operation", + "@azure/arm-rediscache!OperationDisplay:interface": "Microsoft.Cache.OperationDisplay", + "@azure/arm-rediscache!ErrorResponse:interface": "Azure.ResourceManager.CommonTypes.ErrorResponse", + "@azure/arm-rediscache!ErrorDetail:interface": "Azure.ResourceManager.CommonTypes.ErrorDetail", + "@azure/arm-rediscache!ErrorAdditionalInfo:interface": "Azure.ResourceManager.CommonTypes.ErrorAdditionalInfo", + "@azure/arm-rediscache!RedisLinkedServerWithProperties:interface": "Microsoft.Cache.RedisLinkedServerWithProperties", + "@azure/arm-rediscache!RedisLinkedServerProperties:interface": "Microsoft.Cache.RedisLinkedServerProperties", + "@azure/arm-rediscache!RedisLinkedServerCreateProperties:interface": "Microsoft.Cache.RedisLinkedServerCreateProperties", + "@azure/arm-rediscache!ProxyResource:interface": "Azure.ResourceManager.CommonTypes.ProxyResource", + "@azure/arm-rediscache!Resource:interface": "Azure.ResourceManager.CommonTypes.Resource", + "@azure/arm-rediscache!SystemData:interface": "Azure.ResourceManager.CommonTypes.SystemData", + "@azure/arm-rediscache!RedisLinkedServerCreateParameters:interface": "Microsoft.Cache.RedisLinkedServerCreateParameters", + "@azure/arm-rediscache!ArmOperationStatusResourceProvisioningState:interface": "Azure.ResourceManager.ArmOperationStatus", + "@azure/arm-rediscache!RedisLinkedServerWithPropertiesList:interface": "Microsoft.Cache.RedisLinkedServerWithPropertiesList", + "@azure/arm-rediscache!PrivateEndpointConnection:interface": "Microsoft.Cache.PrivateEndpointConnection", + "@azure/arm-rediscache!PrivateEndpointConnectionProperties:interface": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProperties", + "@azure/arm-rediscache!PrivateEndpoint:interface": "Azure.ResourceManager.CommonTypes.PrivateEndpoint", + "@azure/arm-rediscache!PrivateLinkServiceConnectionState:interface": "Azure.ResourceManager.CommonTypes.PrivateLinkServiceConnectionState", + "@azure/arm-rediscache!PrivateEndpointConnectionListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-rediscache!RedisResource:interface": "Microsoft.Cache.RedisResource", + "@azure/arm-rediscache!RedisProperties:interface": "Microsoft.Cache.RedisProperties", + "@azure/arm-rediscache!RedisAccessKeys:interface": "Microsoft.Cache.RedisAccessKeys", + "@azure/arm-rediscache!RedisLinkedServer:interface": "Microsoft.Cache.RedisLinkedServer", + "@azure/arm-rediscache!RedisInstanceDetails:interface": "Microsoft.Cache.RedisInstanceDetails", + "@azure/arm-rediscache!RedisCreateProperties:interface": "Microsoft.Cache.RedisCreateProperties", + "@azure/arm-rediscache!Sku:interface": "Microsoft.Cache.Sku", + "@azure/arm-rediscache!RedisCommonProperties:interface": "Microsoft.Cache.RedisCommonProperties", + "@azure/arm-rediscache!RedisCommonPropertiesRedisConfiguration:interface": "Microsoft.Cache.RedisCommonPropertiesRedisConfiguration", + "@azure/arm-rediscache!ManagedServiceIdentity:interface": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentity", + "@azure/arm-rediscache!UserAssignedIdentity:interface": "Azure.ResourceManager.CommonTypes.UserAssignedIdentity", + "@azure/arm-rediscache!TrackedResource:interface": "Azure.ResourceManager.CommonTypes.TrackedResource", + "@azure/arm-rediscache!RedisCreateParameters:interface": "Microsoft.Cache.RedisCreateParameters", + "@azure/arm-rediscache!RedisUpdateParameters:interface": "Microsoft.Cache.RedisUpdateParameters", + "@azure/arm-rediscache!RedisUpdateProperties:interface": "Microsoft.Cache.RedisUpdateProperties", + "@azure/arm-rediscache!RedisListResult:interface": "Microsoft.Cache.RedisListResult", + "@azure/arm-rediscache!NotificationListResponse:interface": "Microsoft.Cache.NotificationListResponse", + "@azure/arm-rediscache!UpgradeNotification:interface": "Microsoft.Cache.UpgradeNotification", + "@azure/arm-rediscache!RedisRegenerateKeyParameters:interface": "Microsoft.Cache.RedisRegenerateKeyParameters", + "@azure/arm-rediscache!RedisRebootParameters:interface": "Microsoft.Cache.RedisRebootParameters", + "@azure/arm-rediscache!RedisForceRebootResponse:interface": "Microsoft.Cache.RedisForceRebootResponse", + "@azure/arm-rediscache!ImportRDBParameters:interface": "Microsoft.Cache.ImportRDBParameters", + "@azure/arm-rediscache!ExportRDBParameters:interface": "Microsoft.Cache.ExportRDBParameters", + "@azure/arm-rediscache!OperationStatusResult:interface": "Azure.ResourceManager.CommonTypes.OperationStatusResult", + "@azure/arm-rediscache!CheckNameAvailabilityParameters:interface": "Microsoft.Cache.CheckNameAvailabilityParameters", + "@azure/arm-rediscache!PrivateLinkResourceListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-rediscache!PrivateLinkResource:interface": "Azure.ResourceManager.CommonTypes.PrivateLinkResource", + "@azure/arm-rediscache!PrivateLinkResourceProperties:interface": "Azure.ResourceManager.CommonTypes.PrivateLinkResourceProperties", + "@azure/arm-rediscache!RedisFirewallRule:interface": "Microsoft.Cache.RedisFirewallRule", + "@azure/arm-rediscache!RedisFirewallRuleProperties:interface": "Microsoft.Cache.RedisFirewallRuleProperties", + "@azure/arm-rediscache!RedisFirewallRuleListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-rediscache!RedisPatchSchedule:interface": "Microsoft.Cache.RedisPatchSchedule", + "@azure/arm-rediscache!ScheduleEntries:interface": "Microsoft.Cache.ScheduleEntries", + "@azure/arm-rediscache!ScheduleEntry:interface": "Microsoft.Cache.ScheduleEntry", + "@azure/arm-rediscache!RedisPatchScheduleListResult:interface": "Azure.ResourceManager.ResourceListResult", + "@azure/arm-rediscache!RedisCacheAccessPolicy:interface": "Microsoft.Cache.RedisCacheAccessPolicy", + "@azure/arm-rediscache!RedisCacheAccessPolicyProperties:interface": "Microsoft.Cache.RedisCacheAccessPolicyProperties", + "@azure/arm-rediscache!RedisCacheAccessPolicyList:interface": "Microsoft.Cache.RedisCacheAccessPolicyList", + "@azure/arm-rediscache!RedisCacheAccessPolicyAssignment:interface": "Microsoft.Cache.RedisCacheAccessPolicyAssignment", + "@azure/arm-rediscache!RedisCacheAccessPolicyAssignmentProperties:interface": "Microsoft.Cache.RedisCacheAccessPolicyAssignmentProperties", + "@azure/arm-rediscache!RedisCacheAccessPolicyAssignmentList:interface": "Microsoft.Cache.RedisCacheAccessPolicyAssignmentList", + "@azure/arm-rediscache!OperationStatus:interface": "Microsoft.Cache.OperationStatus", + "@azure/arm-rediscache!KnownReplicationRole:enum": "Microsoft.Cache.ReplicationRole", + "@azure/arm-rediscache!KnowncreatedByType:enum": "Azure.ResourceManager.CommonTypes.createdByType", + "@azure/arm-rediscache!KnownResourceProvisioningState:enum": "Azure.ResourceManager.ResourceProvisioningState", + "@azure/arm-rediscache!KnownPrivateEndpointServiceConnectionStatus:enum": "Azure.ResourceManager.CommonTypes.PrivateEndpointServiceConnectionStatus", + "@azure/arm-rediscache!KnownPrivateEndpointConnectionProvisioningState:enum": "Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionProvisioningState", + "@azure/arm-rediscache!KnownProvisioningState:enum": "Microsoft.Cache.ProvisioningState", + "@azure/arm-rediscache!KnownSkuName:enum": "Microsoft.Cache.SkuName", + "@azure/arm-rediscache!KnownSkuFamily:enum": "Microsoft.Cache.SkuFamily", + "@azure/arm-rediscache!KnownTlsVersion:enum": "Microsoft.Cache.TlsVersion", + "@azure/arm-rediscache!KnownPublicNetworkAccess:enum": "Microsoft.Cache.PublicNetworkAccess", + "@azure/arm-rediscache!KnownUpdateChannel:enum": "Microsoft.Cache.UpdateChannel", + "@azure/arm-rediscache!KnownZonalAllocationPolicy:enum": "Microsoft.Cache.ZonalAllocationPolicy", + "@azure/arm-rediscache!KnownManagedServiceIdentityType:enum": "Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType", + "@azure/arm-rediscache!KnownRedisKeyType:enum": "Microsoft.Cache.RedisKeyType", + "@azure/arm-rediscache!KnownRebootType:enum": "Microsoft.Cache.RebootType", + "@azure/arm-rediscache!KnownDefaultName:enum": "Microsoft.Cache.DefaultName", + "@azure/arm-rediscache!KnownDayOfWeek:enum": "Microsoft.Cache.DayOfWeek", + "@azure/arm-rediscache!KnownAccessPolicyProvisioningState:enum": "Microsoft.Cache.AccessPolicyProvisioningState", + "@azure/arm-rediscache!KnownAccessPolicyType:enum": "Microsoft.Cache.AccessPolicyType", + "@azure/arm-rediscache!KnownAccessPolicyAssignmentProvisioningState:enum": "Microsoft.Cache.AccessPolicyAssignmentProvisioningState", + "@azure/arm-rediscache!KnownVersions:enum": "Microsoft.Cache.Versions", + "@azure/arm-rediscache!AsyncOperationStatusOperations#get:member": "Microsoft.Cache.AsyncOperationStatusOperationGroup.get", + "@azure/arm-rediscache!AccessPolicyAssignmentOperations#list:member": "Microsoft.Cache.RedisCacheAccessPolicyAssignments.list", + "@azure/arm-rediscache!AccessPolicyAssignmentOperations#delete:member": "Microsoft.Cache.RedisCacheAccessPolicyAssignments.delete", + "@azure/arm-rediscache!AccessPolicyAssignmentOperations#createUpdate:member": "Microsoft.Cache.RedisCacheAccessPolicyAssignments.createUpdate", + "@azure/arm-rediscache!AccessPolicyAssignmentOperations#get:member": "Microsoft.Cache.RedisCacheAccessPolicyAssignments.get", + "@azure/arm-rediscache!AccessPolicyOperations#list:member": "Microsoft.Cache.RedisCacheAccessPolicies.list", + "@azure/arm-rediscache!AccessPolicyOperations#delete:member": "Microsoft.Cache.RedisCacheAccessPolicies.delete", + "@azure/arm-rediscache!AccessPolicyOperations#createUpdate:member": "Microsoft.Cache.RedisCacheAccessPolicies.createUpdate", + "@azure/arm-rediscache!AccessPolicyOperations#get:member": "Microsoft.Cache.RedisCacheAccessPolicies.get", + "@azure/arm-rediscache!PatchSchedulesOperations#listByRedisResource:member": "Microsoft.Cache.RedisPatchSchedules.listByRedisResource", + "@azure/arm-rediscache!PatchSchedulesOperations#delete:member": "Microsoft.Cache.RedisPatchSchedules.delete", + "@azure/arm-rediscache!PatchSchedulesOperations#createOrUpdate:member": "Microsoft.Cache.RedisPatchSchedules.createOrUpdate", + "@azure/arm-rediscache!PatchSchedulesOperations#get:member": "Microsoft.Cache.RedisPatchSchedules.get", + "@azure/arm-rediscache!FirewallRulesOperations#list:member": "Microsoft.Cache.RedisFirewallRules.list", + "@azure/arm-rediscache!FirewallRulesOperations#delete:member": "Microsoft.Cache.RedisFirewallRules.delete", + "@azure/arm-rediscache!FirewallRulesOperations#createOrUpdate:member": "Microsoft.Cache.RedisFirewallRules.createOrUpdate", + "@azure/arm-rediscache!FirewallRulesOperations#get:member": "Microsoft.Cache.RedisFirewallRules.get", + "@azure/arm-rediscache!PrivateLinkResourcesOperations#listByRedisCache:member": "Microsoft.Cache.RedisResources.listByRedisCache", + "@azure/arm-rediscache!RedisOperations#checkNameAvailability:member": "Microsoft.Cache.RedisOperationGroup.checkNameAvailability", + "@azure/arm-rediscache!RedisOperations#flushCache:member": "Microsoft.Cache.RedisResources.flushCache", + "@azure/arm-rediscache!RedisOperations#exportData:member": "Microsoft.Cache.RedisResources.exportData", + "@azure/arm-rediscache!RedisOperations#importData:member": "Microsoft.Cache.RedisResources.importData", + "@azure/arm-rediscache!RedisOperations#forceReboot:member": "Microsoft.Cache.RedisResources.forceReboot", + "@azure/arm-rediscache!RedisOperations#regenerateKey:member": "Microsoft.Cache.RedisResources.regenerateKey", + "@azure/arm-rediscache!RedisOperations#listKeys:member": "Microsoft.Cache.RedisResources.listKeys", + "@azure/arm-rediscache!RedisOperations#listUpgradeNotifications:member": "Microsoft.Cache.RedisResources.listUpgradeNotifications", + "@azure/arm-rediscache!RedisOperations#listBySubscription:member": "Microsoft.Cache.RedisResources.listBySubscription", + "@azure/arm-rediscache!RedisOperations#listByResourceGroup:member": "Microsoft.Cache.RedisResources.listByResourceGroup", + "@azure/arm-rediscache!RedisOperations#delete:member": "Microsoft.Cache.RedisResources.delete", + "@azure/arm-rediscache!RedisOperations#update:member": "Microsoft.Cache.RedisResources.update", + "@azure/arm-rediscache!RedisOperations#create:member": "Microsoft.Cache.RedisResources.create", + "@azure/arm-rediscache!RedisOperations#get:member": "Microsoft.Cache.RedisResources.get", + "@azure/arm-rediscache!PrivateEndpointConnectionsOperations#list:member": "Microsoft.Cache.PrivateEndpointConnections.list", + "@azure/arm-rediscache!PrivateEndpointConnectionsOperations#delete:member": "Microsoft.Cache.PrivateEndpointConnections.delete", + "@azure/arm-rediscache!PrivateEndpointConnectionsOperations#put:member": "Microsoft.Cache.PrivateEndpointConnections.put", + "@azure/arm-rediscache!PrivateEndpointConnectionsOperations#get:member": "Microsoft.Cache.PrivateEndpointConnections.get", + "@azure/arm-rediscache!LinkedServerOperations#list:member": "Microsoft.Cache.LinkedServer.list", + "@azure/arm-rediscache!LinkedServerOperations#delete:member": "Microsoft.Cache.LinkedServer.delete", + "@azure/arm-rediscache!LinkedServerOperations#create:member": "Microsoft.Cache.LinkedServer.create", + "@azure/arm-rediscache!LinkedServerOperations#get:member": "Microsoft.Cache.LinkedServer.get", + "@azure/arm-rediscache!OperationsOperations#list:member": "Azure.ResourceManager.Legacy.Operations.list" + } + } +} diff --git a/sdk/redis/arm-rediscache/package.json b/sdk/redis/arm-rediscache/package.json index 287136f56ee4..acb2d18e3515 100644 --- a/sdk/redis/arm-rediscache/package.json +++ b/sdk/redis/arm-rediscache/package.json @@ -1,116 +1,131 @@ { "name": "@azure/arm-rediscache", - "sdk-type": "mgmt", - "author": "Microsoft Corporation", + "version": "9.0.0", "description": "A generated SDK for RedisManagementClient.", - "version": "8.2.2", "engines": { "node": ">=20.0.0" }, - "dependencies": { - "@azure/abort-controller": "^2.1.2", - "@azure/core-auth": "^1.9.0", - "@azure/core-client": "^1.9.2", - "@azure/core-lro": "^2.5.4", - "@azure/core-paging": "^1.6.2", - "@azure/core-rest-pipeline": "^1.19.0", - "tslib": "^2.8.1" + "sideEffects": false, + "autoPublish": false, + "tshy": { + "exports": { + "./package.json": "./package.json", + ".": "./src/index.ts", + "./api": "./src/api/index.ts", + "./api/asyncOperationStatus": "./src/api/asyncOperationStatus/index.ts", + "./api/accessPolicyAssignment": "./src/api/accessPolicyAssignment/index.ts", + "./api/accessPolicy": "./src/api/accessPolicy/index.ts", + "./api/patchSchedules": "./src/api/patchSchedules/index.ts", + "./api/firewallRules": "./src/api/firewallRules/index.ts", + "./api/privateLinkResources": "./src/api/privateLinkResources/index.ts", + "./api/redis": "./src/api/redis/index.ts", + "./api/privateEndpointConnections": "./src/api/privateEndpointConnections/index.ts", + "./api/linkedServer": "./src/api/linkedServer/index.ts", + "./api/operations": "./src/api/operations/index.ts", + "./models": "./src/models/index.ts" + }, + "dialects": [ + "esm", + "commonjs" + ], + "esmDialects": [ + "browser", + "react-native" + ], + "selfLink": false, + "project": "../../../tsconfig.src.build.json" }, + "type": "module", + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "keywords": [ "node", "azure", + "cloud", "typescript", "browser", - "isomorphic", - "cloud" + "isomorphic" ], + "author": "Microsoft Corporation", "license": "MIT", - "main": "./dist/commonjs/index.js", - "module": "./dist/esm/index.js", - "types": "./dist/commonjs/index.d.ts", + "files": [ + "dist/", + "!dist/**/*.d.*ts.map", + "README.md", + "LICENSE" + ], + "sdk-type": "mgmt", + "repository": "github:Azure/azure-sdk-for-js", + "bugs": { + "url": "https://github.com/Azure/azure-sdk-for-js/issues" + }, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/README.md", + "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", + "//metadata": { + "constantPaths": [ + { + "path": "src/api/redisManagementContext.ts", + "prefix": "userAgentInfo" + } + ] + }, + "dependencies": { + "@azure/core-util": "^1.12.0", + "@azure-rest/core-client": "^2.3.1", + "@azure/abort-controller": "^2.1.2", + "@azure/core-auth": "^1.9.0", + "@azure/core-lro": "^3.1.0", + "@azure/core-rest-pipeline": "^1.20.0", + "@azure/logger": "^1.2.0", + "tslib": "^2.8.1" + }, "devDependencies": { - "@azure-tools/test-credential": "workspace:^", - "@azure-tools/test-recorder": "workspace:^", - "@azure-tools/test-utils-vitest": "workspace:^", "@azure/arm-network": "^32.2.0", - "@azure/dev-tool": "workspace:^", + "@azure-tools/test-credential": "workspace:*", + "@azure-tools/test-recorder": "workspace:*", + "@azure-tools/test-utils-vitest": "workspace:*", + "@azure/dev-tool": "workspace:*", + "tshy": "catalog:", + "@azure/eslint-plugin-azure-sdk": "workspace:*", "@azure/identity": "catalog:internal", - "@azure/logger": "^1.1.4", "@types/node": "catalog:", + "cross-env": "catalog:", + "eslint": "catalog:", + "prettier": "catalog:", + "rimraf": "catalog:", "@vitest/browser": "catalog:testing", "@vitest/coverage-istanbul": "catalog:testing", - "cross-env": "catalog:", "dotenv": "catalog:testing", "playwright": "catalog:testing", - "rimraf": "catalog:", - "tshy": "catalog:", "typescript": "catalog:", "vitest": "catalog:testing" }, - "repository": "github:Azure/azure-sdk-for-js", - "bugs": { - "url": "https://github.com/Azure/azure-sdk-for-js/issues" - }, - "files": [ - "dist/", - "README.md", - "LICENSE", - "review/", - "CHANGELOG.md" - ], "scripts": { - "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", - "build:samples": "tsc -p tsconfig.samples.json", - "check-format": "echo skipped", "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "echo skipped", - "extract-api": "dev-tool run extract-api", - "format": "echo skipped", - "lint": "echo skipped", + "extract-api": "rimraf review && dev-tool run extract-api", "pack": "pnpm pack 2>&1", + "lint": "echo skipped", + "lint:fix": "echo skipped", + "build:samples": "tsc -p tsconfig.samples.json && dev-tool samples publish -f", + "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "execute:samples": "dev-tool samples run samples-dev", + "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", + "generate:client": "echo skipped", + "test:browser": "dev-tool run build-test && dev-tool run test:vitest --browser", + "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", + "test:node": "dev-tool run test:vitest", + "test:node:esm": "dev-tool run test:vitest --esm", "test": "npm run test:node && npm run test:browser", - "test:browser": "echo skipped", - "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest", "update-snippets": "dev-tool run update-snippets" }, - "sideEffects": false, - "//metadata": { - "constantPaths": [ - { - "path": "src/redisManagementClient.ts", - "prefix": "packageDetails" - } - ] - }, - "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache", "//sampleConfiguration": { - "productName": "", + "productName": "@azure/arm-rediscache", "productSlugs": [ "azure" ], "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview" }, - "type": "module", - "tshy": { - "project": "../../../tsconfig.src.build.json", - "exports": { - "./package.json": "./package.json", - ".": "./src/index.ts" - }, - "dialects": [ - "esm", - "commonjs" - ], - "esmDialects": [ - "browser", - "react-native" - ], - "selfLink": false - }, - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -130,6 +145,225 @@ "types": "./dist/commonjs/index.d.ts", "default": "./dist/commonjs/index.js" } + }, + "./api": { + "browser": { + "types": "./dist/browser/api/index.d.ts", + "default": "./dist/browser/api/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/index.d.ts", + "default": "./dist/react-native/api/index.js" + }, + "import": { + "types": "./dist/esm/api/index.d.ts", + "default": "./dist/esm/api/index.js" + }, + "require": { + "types": "./dist/commonjs/api/index.d.ts", + "default": "./dist/commonjs/api/index.js" + } + }, + "./api/asyncOperationStatus": { + "browser": { + "types": "./dist/browser/api/asyncOperationStatus/index.d.ts", + "default": "./dist/browser/api/asyncOperationStatus/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/asyncOperationStatus/index.d.ts", + "default": "./dist/react-native/api/asyncOperationStatus/index.js" + }, + "import": { + "types": "./dist/esm/api/asyncOperationStatus/index.d.ts", + "default": "./dist/esm/api/asyncOperationStatus/index.js" + }, + "require": { + "types": "./dist/commonjs/api/asyncOperationStatus/index.d.ts", + "default": "./dist/commonjs/api/asyncOperationStatus/index.js" + } + }, + "./api/accessPolicyAssignment": { + "browser": { + "types": "./dist/browser/api/accessPolicyAssignment/index.d.ts", + "default": "./dist/browser/api/accessPolicyAssignment/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/accessPolicyAssignment/index.d.ts", + "default": "./dist/react-native/api/accessPolicyAssignment/index.js" + }, + "import": { + "types": "./dist/esm/api/accessPolicyAssignment/index.d.ts", + "default": "./dist/esm/api/accessPolicyAssignment/index.js" + }, + "require": { + "types": "./dist/commonjs/api/accessPolicyAssignment/index.d.ts", + "default": "./dist/commonjs/api/accessPolicyAssignment/index.js" + } + }, + "./api/accessPolicy": { + "browser": { + "types": "./dist/browser/api/accessPolicy/index.d.ts", + "default": "./dist/browser/api/accessPolicy/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/accessPolicy/index.d.ts", + "default": "./dist/react-native/api/accessPolicy/index.js" + }, + "import": { + "types": "./dist/esm/api/accessPolicy/index.d.ts", + "default": "./dist/esm/api/accessPolicy/index.js" + }, + "require": { + "types": "./dist/commonjs/api/accessPolicy/index.d.ts", + "default": "./dist/commonjs/api/accessPolicy/index.js" + } + }, + "./api/patchSchedules": { + "browser": { + "types": "./dist/browser/api/patchSchedules/index.d.ts", + "default": "./dist/browser/api/patchSchedules/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/patchSchedules/index.d.ts", + "default": "./dist/react-native/api/patchSchedules/index.js" + }, + "import": { + "types": "./dist/esm/api/patchSchedules/index.d.ts", + "default": "./dist/esm/api/patchSchedules/index.js" + }, + "require": { + "types": "./dist/commonjs/api/patchSchedules/index.d.ts", + "default": "./dist/commonjs/api/patchSchedules/index.js" + } + }, + "./api/firewallRules": { + "browser": { + "types": "./dist/browser/api/firewallRules/index.d.ts", + "default": "./dist/browser/api/firewallRules/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/firewallRules/index.d.ts", + "default": "./dist/react-native/api/firewallRules/index.js" + }, + "import": { + "types": "./dist/esm/api/firewallRules/index.d.ts", + "default": "./dist/esm/api/firewallRules/index.js" + }, + "require": { + "types": "./dist/commonjs/api/firewallRules/index.d.ts", + "default": "./dist/commonjs/api/firewallRules/index.js" + } + }, + "./api/privateLinkResources": { + "browser": { + "types": "./dist/browser/api/privateLinkResources/index.d.ts", + "default": "./dist/browser/api/privateLinkResources/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateLinkResources/index.d.ts", + "default": "./dist/react-native/api/privateLinkResources/index.js" + }, + "import": { + "types": "./dist/esm/api/privateLinkResources/index.d.ts", + "default": "./dist/esm/api/privateLinkResources/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateLinkResources/index.d.ts", + "default": "./dist/commonjs/api/privateLinkResources/index.js" + } + }, + "./api/redis": { + "browser": { + "types": "./dist/browser/api/redis/index.d.ts", + "default": "./dist/browser/api/redis/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/redis/index.d.ts", + "default": "./dist/react-native/api/redis/index.js" + }, + "import": { + "types": "./dist/esm/api/redis/index.d.ts", + "default": "./dist/esm/api/redis/index.js" + }, + "require": { + "types": "./dist/commonjs/api/redis/index.d.ts", + "default": "./dist/commonjs/api/redis/index.js" + } + }, + "./api/privateEndpointConnections": { + "browser": { + "types": "./dist/browser/api/privateEndpointConnections/index.d.ts", + "default": "./dist/browser/api/privateEndpointConnections/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/privateEndpointConnections/index.d.ts", + "default": "./dist/react-native/api/privateEndpointConnections/index.js" + }, + "import": { + "types": "./dist/esm/api/privateEndpointConnections/index.d.ts", + "default": "./dist/esm/api/privateEndpointConnections/index.js" + }, + "require": { + "types": "./dist/commonjs/api/privateEndpointConnections/index.d.ts", + "default": "./dist/commonjs/api/privateEndpointConnections/index.js" + } + }, + "./api/linkedServer": { + "browser": { + "types": "./dist/browser/api/linkedServer/index.d.ts", + "default": "./dist/browser/api/linkedServer/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/linkedServer/index.d.ts", + "default": "./dist/react-native/api/linkedServer/index.js" + }, + "import": { + "types": "./dist/esm/api/linkedServer/index.d.ts", + "default": "./dist/esm/api/linkedServer/index.js" + }, + "require": { + "types": "./dist/commonjs/api/linkedServer/index.d.ts", + "default": "./dist/commonjs/api/linkedServer/index.js" + } + }, + "./api/operations": { + "browser": { + "types": "./dist/browser/api/operations/index.d.ts", + "default": "./dist/browser/api/operations/index.js" + }, + "react-native": { + "types": "./dist/react-native/api/operations/index.d.ts", + "default": "./dist/react-native/api/operations/index.js" + }, + "import": { + "types": "./dist/esm/api/operations/index.d.ts", + "default": "./dist/esm/api/operations/index.js" + }, + "require": { + "types": "./dist/commonjs/api/operations/index.d.ts", + "default": "./dist/commonjs/api/operations/index.js" + } + }, + "./models": { + "browser": { + "types": "./dist/browser/models/index.d.ts", + "default": "./dist/browser/models/index.js" + }, + "react-native": { + "types": "./dist/react-native/models/index.d.ts", + "default": "./dist/react-native/models/index.js" + }, + "import": { + "types": "./dist/esm/models/index.d.ts", + "default": "./dist/esm/models/index.js" + }, + "require": { + "types": "./dist/commonjs/models/index.d.ts", + "default": "./dist/commonjs/models/index.js" + } } - } + }, + "main": "./dist/commonjs/index.js", + "types": "./dist/commonjs/index.d.ts", + "module": "./dist/esm/index.js" } diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicy-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicy-node.api.md new file mode 100644 index 000000000000..c17d9528c165 --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicy-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams): PollerLike, void>; + +// @public +export interface AccessPolicyCreateUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyGetOptionalParams extends OperationOptions { +} + +// @public +export interface AccessPolicyListOptionalParams extends OperationOptions { +} + +// @public +export function createUpdate(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams): PollerLike, RedisCacheAccessPolicy>; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyGetOptionalParams): Promise; + +// @public +export function list(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: AccessPolicyListOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicyAssignment-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicyAssignment-node.api.md new file mode 100644 index 000000000000..f4a30d040f8f --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-accessPolicyAssignment-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentDeleteOptionalParams): PollerLike, void>; + +// @public +export interface AccessPolicyAssignmentCreateUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyAssignmentDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface AccessPolicyAssignmentGetOptionalParams extends OperationOptions { +} + +// @public +export interface AccessPolicyAssignmentListOptionalParams extends OperationOptions { +} + +// @public +export function createUpdate(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, parameters: RedisCacheAccessPolicyAssignment, options?: AccessPolicyAssignmentCreateUpdateOptionalParams): PollerLike, RedisCacheAccessPolicyAssignment>; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentGetOptionalParams): Promise; + +// @public +export function list(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: AccessPolicyAssignmentListOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-asyncOperationStatus-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-asyncOperationStatus-node.api.md new file mode 100644 index 000000000000..f83c5680572c --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-asyncOperationStatus-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export interface AsyncOperationStatusGetOptionalParams extends OperationOptions { +} + +// @public +export function get(context: RedisManagementContext, location: string, operationId: string, options?: AsyncOperationStatusGetOptionalParams): Promise; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-firewallRules-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-firewallRules-node.api.md new file mode 100644 index 000000000000..1d740a4b189f --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-firewallRules-node.api.md @@ -0,0 +1,40 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesDeleteOptionalParams): Promise; + +// @public +export function createOrUpdate(context: RedisManagementContext, resourceGroupName: string, cacheName: string, ruleName: string, parameters: RedisFirewallRule, options?: FirewallRulesCreateOrUpdateOptionalParams): Promise; + +// @public +export interface FirewallRulesCreateOrUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface FirewallRulesDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface FirewallRulesGetOptionalParams extends OperationOptions { +} + +// @public +export interface FirewallRulesListOptionalParams extends OperationOptions { +} + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesGetOptionalParams): Promise; + +// @public +export function list(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: FirewallRulesListOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-linkedServer-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-linkedServer-node.api.md new file mode 100644 index 000000000000..2ea057b8bb40 --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-linkedServer-node.api.md @@ -0,0 +1,44 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): PollerLike, void>; + +// @public +export function create(context: RedisManagementContext, resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): PollerLike, RedisLinkedServerWithProperties>; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerGetOptionalParams): Promise; + +// @public +export interface LinkedServerCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LinkedServerDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface LinkedServerGetOptionalParams extends OperationOptions { +} + +// @public +export interface LinkedServerListOptionalParams extends OperationOptions { +} + +// @public +export function list(context: RedisManagementContext, resourceGroupName: string, name: string, options?: LinkedServerListOptionalParams): PagedAsyncIterableIterator; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-node.api.md new file mode 100644 index 000000000000..dfb6a6d4930b --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-node.api.md @@ -0,0 +1,28 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { TokenCredential } from '@azure/core-auth'; + +// @public +export function createRedisManagement(credential: TokenCredential, subscriptionId: string, options?: RedisManagementClientOptionalParams): RedisManagementContext; + +// @public +export interface RedisManagementClientOptionalParams extends ClientOptions { + apiVersion?: string; + cloudSetting?: AzureSupportedClouds; +} + +// @public +export interface RedisManagementContext extends Client { + apiVersion: string; + subscriptionId: string; +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-operations-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-operations-node.api.md new file mode 100644 index 000000000000..e550b194141d --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-operations-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function list(context: RedisManagementContext, options?: OperationsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface OperationsListOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-patchSchedules-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-patchSchedules-node.api.md new file mode 100644 index 000000000000..e968ba054cdc --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-patchSchedules-node.api.md @@ -0,0 +1,40 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesDeleteOptionalParams): Promise; + +// @public +export function createOrUpdate(context: RedisManagementContext, resourceGroupName: string, name: string, defaultParam: DefaultName, parameters: RedisPatchSchedule, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesGetOptionalParams): Promise; + +// @public +export function listByRedisResource(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: PatchSchedulesListByRedisResourceOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PatchSchedulesCreateOrUpdateOptionalParams extends OperationOptions { +} + +// @public +export interface PatchSchedulesDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface PatchSchedulesGetOptionalParams extends OperationOptions { +} + +// @public +export interface PatchSchedulesListByRedisResourceOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateEndpointConnections-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateEndpointConnections-node.api.md new file mode 100644 index 000000000000..a25ef19b8b99 --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateEndpointConnections-node.api.md @@ -0,0 +1,43 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; + +// @public +export function list(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { +} + +// @public +export interface PrivateEndpointConnectionsPutOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function put(context: RedisManagementContext, resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): PollerLike, PrivateEndpointConnection>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateLinkResources-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateLinkResources-node.api.md new file mode 100644 index 000000000000..2fc1c180c57b --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-privateLinkResources-node.api.md @@ -0,0 +1,19 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; + +// @public +export function listByRedisCache(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: PrivateLinkResourcesListByRedisCacheOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface PrivateLinkResourcesListByRedisCacheOptionalParams extends OperationOptions { +} + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-api-redis-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-api-redis-node.api.md new file mode 100644 index 000000000000..8eb56a35c19f --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-api-redis-node.api.md @@ -0,0 +1,118 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import type { Client } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PollerLike } from '@azure/core-lro'; + +// @public +export function $delete(context: RedisManagementContext, resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): PollerLike, void>; + +// @public +export function checkNameAvailability(context: RedisManagementContext, parameters: CheckNameAvailabilityParameters, options?: RedisCheckNameAvailabilityOptionalParams): Promise; + +// @public +export function create(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): PollerLike, RedisResource>; + +// @public +export function exportData(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): PollerLike, void>; + +// @public +export function flushCache(context: RedisManagementContext, resourceGroupName: string, cacheName: string, options?: RedisFlushCacheOptionalParams): PollerLike, OperationStatusResult>; + +// @public +export function forceReboot(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: RedisRebootParameters, options?: RedisForceRebootOptionalParams): Promise; + +// @public +export function get(context: RedisManagementContext, resourceGroupName: string, name: string, options?: RedisGetOptionalParams): Promise; + +// @public +export function importData(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): PollerLike, void>; + +// @public +export function listByResourceGroup(context: RedisManagementContext, resourceGroupName: string, options?: RedisListByResourceGroupOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listBySubscription(context: RedisManagementContext, options?: RedisListBySubscriptionOptionalParams): PagedAsyncIterableIterator; + +// @public +export function listKeys(context: RedisManagementContext, resourceGroupName: string, name: string, options?: RedisListKeysOptionalParams): Promise; + +// @public +export function listUpgradeNotifications(context: RedisManagementContext, resourceGroupName: string, name: string, history: number, options?: RedisListUpgradeNotificationsOptionalParams): PagedAsyncIterableIterator; + +// @public +export interface RedisCheckNameAvailabilityOptionalParams extends OperationOptions { +} + +// @public +export interface RedisCreateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface RedisDeleteOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface RedisExportDataOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface RedisFlushCacheOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface RedisForceRebootOptionalParams extends OperationOptions { +} + +// @public +export interface RedisGetOptionalParams extends OperationOptions { +} + +// @public +export interface RedisImportDataOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export interface RedisListByResourceGroupOptionalParams extends OperationOptions { +} + +// @public +export interface RedisListBySubscriptionOptionalParams extends OperationOptions { +} + +// @public +export interface RedisListKeysOptionalParams extends OperationOptions { +} + +// @public +export interface RedisListUpgradeNotificationsOptionalParams extends OperationOptions { +} + +// @public +export interface RedisRegenerateKeyOptionalParams extends OperationOptions { +} + +// @public +export interface RedisUpdateOptionalParams extends OperationOptions { + updateIntervalInMs?: number; +} + +// @public +export function regenerateKey(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: RedisRegenerateKeyParameters, options?: RedisRegenerateKeyOptionalParams): Promise; + +// @public +export function update(context: RedisManagementContext, resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): PollerLike, RedisResource>; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-models-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-models-node.api.md new file mode 100644 index 000000000000..80f6ad92939d --- /dev/null +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-models-node.api.md @@ -0,0 +1,566 @@ +## API Report File for "@azure/arm-rediscache" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +// @public +export type AccessPolicyAssignmentProvisioningState = string; + +// @public +export type AccessPolicyProvisioningState = string; + +// @public +export type AccessPolicyType = string; + +// @public +export interface CheckNameAvailabilityParameters { + name: string; + type: string; +} + +// @public +export type CreatedByType = string; + +// @public +export type DayOfWeek = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday" | "Everyday" | "Weekend"; + +// @public +export type DefaultName = string; + +// @public +export interface ErrorAdditionalInfo { + readonly info?: any; + readonly type?: string; +} + +// @public +export interface ErrorDetail { + readonly additionalInfo?: ErrorAdditionalInfo[]; + readonly code?: string; + readonly details?: ErrorDetail[]; + readonly message?: string; + readonly target?: string; +} + +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + +// @public +export interface ExportRDBParameters { + container: string; + format?: string; + preferredDataArchiveAuthMethod?: string; + prefix: string; + storageSubscriptionId?: string; +} + +// @public +export interface ImportRDBParameters { + files: string[]; + format?: string; + preferredDataArchiveAuthMethod?: string; + storageSubscriptionId?: string; +} + +// @public +export enum KnownAccessPolicyAssignmentProvisioningState { + Canceled = "Canceled", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownAccessPolicyProvisioningState { + Canceled = "Canceled", + Deleted = "Deleted", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded", + Updating = "Updating" +} + +// @public +export enum KnownAccessPolicyType { + BuiltIn = "BuiltIn", + Custom = "Custom" +} + +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + +// @public +export enum KnownDefaultName { + Default = "default" +} + +// @public +export enum KnownManagedServiceIdentityType { + None = "None", + SystemAssigned = "SystemAssigned", + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", + UserAssigned = "UserAssigned" +} + +// @public +export enum KnownPrivateEndpointConnectionProvisioningState { + Creating = "Creating", + Deleting = "Deleting", + Failed = "Failed", + Succeeded = "Succeeded" +} + +// @public +export enum KnownPrivateEndpointServiceConnectionStatus { + Approved = "Approved", + Pending = "Pending", + Rejected = "Rejected" +} + +// @public +export enum KnownProvisioningState { + ConfiguringAAD = "ConfiguringAAD", + Creating = "Creating", + Deleting = "Deleting", + Disabled = "Disabled", + Failed = "Failed", + Linking = "Linking", + Provisioning = "Provisioning", + RecoveringScaleFailure = "RecoveringScaleFailure", + Scaling = "Scaling", + Succeeded = "Succeeded", + Unlinking = "Unlinking", + Unprovisioning = "Unprovisioning", + Updating = "Updating" +} + +// @public +export enum KnownPublicNetworkAccess { + Disabled = "Disabled", + Enabled = "Enabled" +} + +// @public +export enum KnownRebootType { + AllNodes = "AllNodes", + PrimaryNode = "PrimaryNode", + SecondaryNode = "SecondaryNode" +} + +// @public +export enum KnownSkuFamily { + C = "C", + P = "P" +} + +// @public +export enum KnownSkuName { + Basic = "Basic", + Premium = "Premium", + Standard = "Standard" +} + +// @public +export enum KnownTlsVersion { + One0 = "1.0", + One1 = "1.1", + One2 = "1.2" +} + +// @public +export enum KnownUpdateChannel { + Preview = "Preview", + Stable = "Stable" +} + +// @public +export enum KnownVersions { + V20241101 = "2024-11-01" +} + +// @public +export enum KnownZonalAllocationPolicy { + Automatic = "Automatic", + NoZones = "NoZones", + UserDefined = "UserDefined" +} + +// @public +export interface ManagedServiceIdentity { + readonly principalId?: string; + readonly tenantId?: string; + type: ManagedServiceIdentityType; + userAssignedIdentities?: Record; +} + +// @public +export type ManagedServiceIdentityType = string; + +// @public +export interface Operation { + display?: OperationDisplay; + name?: string; +} + +// @public +export interface OperationDisplay { + description?: string; + operation?: string; + provider?: string; + resource?: string; +} + +// @public +export interface OperationStatus extends OperationStatusResult { + properties?: Record; +} + +// @public +export interface OperationStatusResult { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name?: string; + operations?: OperationStatusResult[]; + percentComplete?: number; + startTime?: Date; + status: string; +} + +// @public +export interface PrivateEndpoint { + readonly id?: string; +} + +// @public +export interface PrivateEndpointConnection extends Resource { + properties?: PrivateEndpointConnectionProperties; +} + +// @public +export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +// @public +export type PrivateEndpointConnectionProvisioningState = string; + +// @public +export type PrivateEndpointServiceConnectionStatus = string; + +// @public +export interface PrivateLinkResource extends Resource { + properties?: PrivateLinkResourceProperties; +} + +// @public +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; +} + +// @public +export interface PrivateLinkServiceConnectionState { + actionsRequired?: string; + description?: string; + status?: PrivateEndpointServiceConnectionStatus; +} + +// @public +export type ProvisioningState = string; + +// @public +export interface ProxyResource extends Resource { +} + +// @public +export type PublicNetworkAccess = string; + +// @public +export type RebootType = string; + +// @public +export interface RedisAccessKeys { + readonly primaryKey?: string; + readonly secondaryKey?: string; +} + +// @public +export interface RedisCacheAccessPolicy extends ProxyResource { + properties?: RedisCacheAccessPolicyProperties; +} + +// @public +export interface RedisCacheAccessPolicyAssignment extends ProxyResource { + properties?: RedisCacheAccessPolicyAssignmentProperties; +} + +// @public +export interface RedisCacheAccessPolicyAssignmentProperties { + accessPolicyName: string; + objectId: string; + objectIdAlias: string; + readonly provisioningState?: AccessPolicyAssignmentProvisioningState; +} + +// @public +export interface RedisCacheAccessPolicyProperties { + permissions: string; + readonly provisioningState?: AccessPolicyProvisioningState; + readonly type?: AccessPolicyType; +} + +// @public +export interface RedisCommonProperties { + disableAccessKeyAuthentication?: boolean; + enableNonSslPort?: boolean; + minimumTlsVersion?: TlsVersion; + publicNetworkAccess?: PublicNetworkAccess; + redisConfiguration?: RedisCommonPropertiesRedisConfiguration; + redisVersion?: string; + replicasPerMaster?: number; + replicasPerPrimary?: number; + shardCount?: number; + tenantSettings?: Record; + updateChannel?: UpdateChannel; + zonalAllocationPolicy?: ZonalAllocationPolicy; +} + +// @public +export interface RedisCommonPropertiesRedisConfiguration { + aadEnabled?: string; + additionalProperties?: Record; + aofBackupEnabled?: string; + aofStorageConnectionString0?: string; + aofStorageConnectionString1?: string; + authnotrequired?: string; + readonly maxclients?: string; + maxfragmentationmemoryReserved?: string; + maxmemoryDelta?: string; + maxmemoryPolicy?: string; + maxmemoryReserved?: string; + notifyKeyspaceEvents?: string; + readonly preferredDataArchiveAuthMethod?: string; + preferredDataPersistenceAuthMethod?: string; + rdbBackupEnabled?: string; + rdbBackupFrequency?: string; + rdbBackupMaxSnapshotCount?: string; + rdbStorageConnectionString?: string; + storageSubscriptionId?: string; + readonly zonalConfiguration?: string; +} + +// @public +export interface RedisCreateParameters { + identity?: ManagedServiceIdentity; + location: string; + properties: RedisCreateProperties; + tags?: Record; + zones?: string[]; +} + +// @public +export interface RedisCreateProperties extends RedisCommonProperties { + sku: Sku; + staticIP?: string; + subnetId?: string; +} + +// @public +export interface RedisFirewallRule extends ProxyResource { + properties: RedisFirewallRuleProperties; +} + +// @public +export interface RedisFirewallRuleProperties { + endIP: string; + startIP: string; +} + +// @public +export interface RedisForceRebootResponse { + readonly message?: string; +} + +// @public +export interface RedisInstanceDetails { + readonly isMaster?: boolean; + readonly isPrimary?: boolean; + readonly nonSslPort?: number; + readonly shardId?: number; + readonly sslPort?: number; + readonly zone?: string; +} + +// @public +export type RedisKeyType = "Primary" | "Secondary"; + +// @public +export interface RedisLinkedServer { + readonly id?: string; +} + +// @public +export interface RedisLinkedServerCreateParameters { + properties: RedisLinkedServerCreateProperties; +} + +// @public +export interface RedisLinkedServerCreateProperties { + readonly geoReplicatedPrimaryHostName?: string; + linkedRedisCacheId: string; + linkedRedisCacheLocation: string; + readonly primaryHostName?: string; + serverRole: ReplicationRole; +} + +// @public +export interface RedisLinkedServerProperties extends RedisLinkedServerCreateProperties { + readonly provisioningState?: string; +} + +// @public +export interface RedisLinkedServerWithProperties extends ProxyResource { + properties?: RedisLinkedServerProperties; +} + +// @public +export interface RedisPatchSchedule extends ProxyResource { + readonly location?: string; + properties: ScheduleEntries; +} + +// @public +export interface RedisProperties extends RedisCreateProperties { + readonly accessKeys?: RedisAccessKeys; + readonly hostName?: string; + readonly instances?: RedisInstanceDetails[]; + readonly linkedServers?: RedisLinkedServer[]; + readonly port?: number; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; + readonly sslPort?: number; +} + +// @public +export interface RedisRebootParameters { + ports?: number[]; + rebootType?: RebootType; + shardId?: number; +} + +// @public +export interface RedisRegenerateKeyParameters { + keyType: RedisKeyType; +} + +// @public +export interface RedisResource extends TrackedResource { + identity?: ManagedServiceIdentity; + properties: RedisProperties; + zones?: string[]; +} + +// @public +export interface RedisUpdateParameters { + identity?: ManagedServiceIdentity; + properties?: RedisUpdateProperties; + tags?: Record; +} + +// @public +export interface RedisUpdateProperties extends RedisCommonProperties { + sku?: Sku; +} + +// @public +export type ReplicationRole = "Primary" | "Secondary"; + +// @public +export interface Resource { + readonly id?: string; + readonly name?: string; + readonly systemData?: SystemData; + readonly type?: string; +} + +// @public +export interface ScheduleEntries { + scheduleEntries: ScheduleEntry[]; +} + +// @public +export interface ScheduleEntry { + dayOfWeek: DayOfWeek; + maintenanceWindow?: string; + startHourUtc: number; +} + +// @public +export interface Sku { + capacity: number; + family: SkuFamily; + name: SkuName; +} + +// @public +export type SkuFamily = string; + +// @public +export type SkuName = string; + +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + +// @public +export type TlsVersion = string; + +// @public +export interface TrackedResource extends Resource { + location: string; + tags?: Record; +} + +// @public +export type UpdateChannel = string; + +// @public +export interface UpgradeNotification { + readonly name?: string; + readonly timestamp?: Date; + readonly upsellNotification?: Record; +} + +// @public +export interface UserAssignedIdentity { + readonly clientId?: string; + readonly principalId?: string; +} + +// @public +export type ZonalAllocationPolicy = string; + +// (No @packageDocumentation comment for this package) + +``` diff --git a/sdk/redis/arm-rediscache/review/arm-rediscache-node.api.md b/sdk/redis/arm-rediscache/review/arm-rediscache-node.api.md index 74140f9b93ba..72970c432aa3 100644 --- a/sdk/redis/arm-rediscache/review/arm-rediscache-node.api.md +++ b/sdk/redis/arm-rediscache/review/arm-rediscache-node.api.md @@ -4,119 +4,70 @@ ```ts -import * as coreAuth from '@azure/core-auth'; -import * as coreClient from '@azure/core-client'; -import { OperationState } from '@azure/core-lro'; -import { PagedAsyncIterableIterator } from '@azure/core-paging'; -import { SimplePollerLike } from '@azure/core-lro'; +import type { AbortSignalLike } from '@azure/abort-controller'; +import type { ClientOptions } from '@azure-rest/core-client'; +import type { OperationOptions } from '@azure-rest/core-client'; +import type { OperationState } from '@azure/core-lro'; +import type { PathUncheckedResponse } from '@azure-rest/core-client'; +import type { Pipeline } from '@azure/core-rest-pipeline'; +import type { PollerLike } from '@azure/core-lro'; +import type { TokenCredential } from '@azure/core-auth'; // @public -export interface AccessPolicy { - beginCreateUpdate(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams): Promise, AccessPolicyCreateUpdateResponse>>; - beginCreateUpdateAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams): Promise; - get(resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyGetOptionalParams): Promise; - list(resourceGroupName: string, cacheName: string, options?: AccessPolicyListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface AccessPolicyAssignment { - beginCreateUpdate(resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, parameters: RedisCacheAccessPolicyAssignment, options?: AccessPolicyAssignmentCreateUpdateOptionalParams): Promise, AccessPolicyAssignmentCreateUpdateResponse>>; - beginCreateUpdateAndWait(resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, parameters: RedisCacheAccessPolicyAssignment, options?: AccessPolicyAssignmentCreateUpdateOptionalParams): Promise; - beginDelete(resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentDeleteOptionalParams): Promise; - get(resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentGetOptionalParams): Promise; - list(resourceGroupName: string, cacheName: string, options?: AccessPolicyAssignmentListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface AccessPolicyAssignmentCreateUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AccessPolicyAssignmentCreateUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type AccessPolicyAssignmentCreateUpdateResponse = RedisCacheAccessPolicyAssignment; - -// @public -export interface AccessPolicyAssignmentDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface AccessPolicyAssignmentDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AccessPolicyAssignmentDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface AccessPolicyAssignmentGetOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyAssignmentGetOptionalParams extends OperationOptions { } // @public -export type AccessPolicyAssignmentGetResponse = RedisCacheAccessPolicyAssignment; - -// @public -export interface AccessPolicyAssignmentListNextOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyAssignmentListOptionalParams extends OperationOptions { } // @public -export type AccessPolicyAssignmentListNextResponse = RedisCacheAccessPolicyAssignmentList; - -// @public -export interface AccessPolicyAssignmentListOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyAssignmentOperations { + createUpdate: (resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, parameters: RedisCacheAccessPolicyAssignment, options?: AccessPolicyAssignmentCreateUpdateOptionalParams) => PollerLike, RedisCacheAccessPolicyAssignment>; + delete: (resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cacheName: string, accessPolicyAssignmentName: string, options?: AccessPolicyAssignmentGetOptionalParams) => Promise; + list: (resourceGroupName: string, cacheName: string, options?: AccessPolicyAssignmentListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type AccessPolicyAssignmentListResponse = RedisCacheAccessPolicyAssignmentList; - // @public export type AccessPolicyAssignmentProvisioningState = string; // @public -export interface AccessPolicyCreateUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AccessPolicyCreateUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type AccessPolicyCreateUpdateResponse = RedisCacheAccessPolicy; - -// @public -export interface AccessPolicyDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface AccessPolicyDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface AccessPolicyDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface AccessPolicyGetOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyGetOptionalParams extends OperationOptions { } // @public -export type AccessPolicyGetResponse = RedisCacheAccessPolicy; - -// @public -export interface AccessPolicyListNextOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyListOptionalParams extends OperationOptions { } // @public -export type AccessPolicyListNextResponse = RedisCacheAccessPolicyList; - -// @public -export interface AccessPolicyListOptionalParams extends coreClient.OperationOptions { +export interface AccessPolicyOperations { + createUpdate: (resourceGroupName: string, cacheName: string, accessPolicyName: string, parameters: RedisCacheAccessPolicy, options?: AccessPolicyCreateUpdateOptionalParams) => PollerLike, RedisCacheAccessPolicy>; + delete: (resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, cacheName: string, accessPolicyName: string, options?: AccessPolicyGetOptionalParams) => Promise; + list: (resourceGroupName: string, cacheName: string, options?: AccessPolicyListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type AccessPolicyListResponse = RedisCacheAccessPolicyList; - // @public export type AccessPolicyProvisioningState = string; @@ -124,16 +75,23 @@ export type AccessPolicyProvisioningState = string; export type AccessPolicyType = string; // @public -export interface AsyncOperationStatus { - get(location: string, operationId: string, options?: AsyncOperationStatusGetOptionalParams): Promise; +export interface AsyncOperationStatusGetOptionalParams extends OperationOptions { +} + +// @public +export interface AsyncOperationStatusOperations { + get: (location: string, operationId: string, options?: AsyncOperationStatusGetOptionalParams) => Promise; } // @public -export interface AsyncOperationStatusGetOptionalParams extends coreClient.OperationOptions { +export enum AzureClouds { + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT" } // @public -export type AsyncOperationStatusGetResponse = OperationStatus; +export type AzureSupportedClouds = `${AzureClouds}`; // @public export interface CheckNameAvailabilityParameters { @@ -141,6 +99,14 @@ export interface CheckNameAvailabilityParameters { type: string; } +// @public +export type ContinuablePage = TPage & { + continuationToken?: string; +}; + +// @public +export type CreatedByType = string; + // @public export type DayOfWeek = "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday" | "Sunday" | "Everyday" | "Weekend"; @@ -149,7 +115,7 @@ export type DefaultName = string; // @public export interface ErrorAdditionalInfo { - readonly info?: Record; + readonly info?: any; readonly type?: string; } @@ -177,48 +143,29 @@ export interface ExportRDBParameters { } // @public -export interface FirewallRules { - createOrUpdate(resourceGroupName: string, cacheName: string, ruleName: string, parameters: RedisFirewallRule, options?: FirewallRulesCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesDeleteOptionalParams): Promise; - get(resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesGetOptionalParams): Promise; - list(resourceGroupName: string, cacheName: string, options?: FirewallRulesListOptionalParams): PagedAsyncIterableIterator; +export interface FirewallRulesCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export interface FirewallRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface FirewallRulesDeleteOptionalParams extends OperationOptions { } // @public -export type FirewallRulesCreateOrUpdateResponse = RedisFirewallRule; - -// @public -export interface FirewallRulesDeleteOptionalParams extends coreClient.OperationOptions { +export interface FirewallRulesGetOptionalParams extends OperationOptions { } // @public -export interface FirewallRulesGetOptionalParams extends coreClient.OperationOptions { +export interface FirewallRulesListOptionalParams extends OperationOptions { } // @public -export type FirewallRulesGetResponse = RedisFirewallRule; - -// @public -export interface FirewallRulesListNextOptionalParams extends coreClient.OperationOptions { +export interface FirewallRulesOperations { + createOrUpdate: (resourceGroupName: string, cacheName: string, ruleName: string, parameters: RedisFirewallRule, options?: FirewallRulesCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, cacheName: string, ruleName: string, options?: FirewallRulesGetOptionalParams) => Promise; + list: (resourceGroupName: string, cacheName: string, options?: FirewallRulesListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type FirewallRulesListNextResponse = RedisFirewallRuleListResult; - -// @public -export interface FirewallRulesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type FirewallRulesListResponse = RedisFirewallRuleListResult; - -// @public -export function getContinuationToken(page: unknown): string | undefined; - // @public export interface ImportRDBParameters { files: string[]; @@ -253,6 +200,14 @@ export enum KnownAccessPolicyType { Custom = "Custom" } +// @public +export enum KnownCreatedByType { + Application = "Application", + Key = "Key", + ManagedIdentity = "ManagedIdentity", + User = "User" +} + // @public export enum KnownDefaultName { Default = "default" @@ -313,9 +268,7 @@ export enum KnownRebootType { // @public export enum KnownSkuFamily { - // (undocumented) C = "C", - // (undocumented) P = "P" } @@ -339,6 +292,11 @@ export enum KnownUpdateChannel { Stable = "Stable" } +// @public +export enum KnownVersions { + V20241101 = "2024-11-01" +} + // @public export enum KnownZonalAllocationPolicy { Automatic = "Automatic", @@ -347,76 +305,42 @@ export enum KnownZonalAllocationPolicy { } // @public -export interface LinkedServer { - beginCreate(resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): Promise, LinkedServerCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams): Promise; - get(resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerGetOptionalParams): Promise; - list(resourceGroupName: string, name: string, options?: LinkedServerListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface LinkedServerCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface LinkedServerCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type LinkedServerCreateResponse = RedisLinkedServerWithProperties; - -// @public -export interface LinkedServerDeleteHeaders { - // (undocumented) - location?: string; -} - -// @public -export interface LinkedServerDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface LinkedServerDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface LinkedServerGetOptionalParams extends coreClient.OperationOptions { +export interface LinkedServerGetOptionalParams extends OperationOptions { } // @public -export type LinkedServerGetResponse = RedisLinkedServerWithProperties; - -// @public -export interface LinkedServerListNextOptionalParams extends coreClient.OperationOptions { +export interface LinkedServerListOptionalParams extends OperationOptions { } // @public -export type LinkedServerListNextResponse = RedisLinkedServerWithPropertiesList; - -// @public -export interface LinkedServerListOptionalParams extends coreClient.OperationOptions { +export interface LinkedServerOperations { + create: (resourceGroupName: string, name: string, linkedServerName: string, parameters: RedisLinkedServerCreateParameters, options?: LinkedServerCreateOptionalParams) => PollerLike, RedisLinkedServerWithProperties>; + delete: (resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerDeleteOptionalParams) => PollerLike, void>; + get: (resourceGroupName: string, name: string, linkedServerName: string, options?: LinkedServerGetOptionalParams) => Promise; + list: (resourceGroupName: string, name: string, options?: LinkedServerListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type LinkedServerListResponse = RedisLinkedServerWithPropertiesList; - // @public export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; type: ManagedServiceIdentityType; - userAssignedIdentities?: { - [propertyName: string]: UserAssignedIdentity; - }; + userAssignedIdentities?: Record; } // @public export type ManagedServiceIdentityType = string; -// @public -export interface NotificationListResponse { - readonly nextLink?: string; - value?: UpgradeNotification[]; -} - // @public export interface Operation { display?: OperationDisplay; @@ -432,35 +356,17 @@ export interface OperationDisplay { } // @public -export interface OperationListResult { - readonly nextLink?: string; - value?: Operation[]; -} - -// @public -export interface Operations { - list(options?: OperationsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface OperationsListNextOptionalParams extends coreClient.OperationOptions { +export interface OperationsListOptionalParams extends OperationOptions { } // @public -export type OperationsListNextResponse = OperationListResult; - -// @public -export interface OperationsListOptionalParams extends coreClient.OperationOptions { +export interface OperationsOperations { + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type OperationsListResponse = OperationListResult; - // @public export interface OperationStatus extends OperationStatusResult { - properties?: { - [propertyName: string]: any; - }; + properties?: Record; } // @public @@ -476,44 +382,40 @@ export interface OperationStatusResult { } // @public -export interface PatchSchedules { - createOrUpdate(resourceGroupName: string, name: string, defaultParam: DefaultName, parameters: RedisPatchSchedule, options?: PatchSchedulesCreateOrUpdateOptionalParams): Promise; - delete(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesDeleteOptionalParams): Promise; - get(resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesGetOptionalParams): Promise; - listByRedisResource(resourceGroupName: string, cacheName: string, options?: PatchSchedulesListByRedisResourceOptionalParams): PagedAsyncIterableIterator; +export interface PagedAsyncIterableIterator { + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; + next(): Promise>; } // @public -export interface PatchSchedulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface PageSettings { + continuationToken?: string; } // @public -export type PatchSchedulesCreateOrUpdateResponse = RedisPatchSchedule; - -// @public -export interface PatchSchedulesDeleteOptionalParams extends coreClient.OperationOptions { +export interface PatchSchedulesCreateOrUpdateOptionalParams extends OperationOptions { } // @public -export interface PatchSchedulesGetOptionalParams extends coreClient.OperationOptions { +export interface PatchSchedulesDeleteOptionalParams extends OperationOptions { } // @public -export type PatchSchedulesGetResponse = RedisPatchSchedule; - -// @public -export interface PatchSchedulesListByRedisResourceNextOptionalParams extends coreClient.OperationOptions { +export interface PatchSchedulesGetOptionalParams extends OperationOptions { } // @public -export type PatchSchedulesListByRedisResourceNextResponse = RedisPatchScheduleListResult; - -// @public -export interface PatchSchedulesListByRedisResourceOptionalParams extends coreClient.OperationOptions { +export interface PatchSchedulesListByRedisResourceOptionalParams extends OperationOptions { } // @public -export type PatchSchedulesListByRedisResourceResponse = RedisPatchScheduleListResult; +export interface PatchSchedulesOperations { + createOrUpdate: (resourceGroupName: string, name: string, defaultParam: DefaultName, parameters: RedisPatchSchedule, options?: PatchSchedulesCreateOrUpdateOptionalParams) => Promise; + delete: (resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, name: string, defaultParam: DefaultName, options?: PatchSchedulesGetOptionalParams) => Promise; + listByRedisResource: (resourceGroupName: string, cacheName: string, options?: PatchSchedulesListByRedisResourceOptionalParams) => PagedAsyncIterableIterator; +} // @public export interface PrivateEndpoint { @@ -522,82 +424,69 @@ export interface PrivateEndpoint { // @public export interface PrivateEndpointConnection extends Resource { - privateEndpoint?: PrivateEndpoint; - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; + properties?: PrivateEndpointConnectionProperties; } // @public -export interface PrivateEndpointConnectionListResult { - value?: PrivateEndpointConnection[]; +export interface PrivateEndpointConnectionProperties { + readonly groupIds?: string[]; + privateEndpoint?: PrivateEndpoint; + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; } // @public export type PrivateEndpointConnectionProvisioningState = string; // @public -export interface PrivateEndpointConnections { - beginPut(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise, PrivateEndpointConnectionsPutResponse>>; - beginPutAndWait(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams): Promise; - delete(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams): Promise; - get(resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams): Promise; - list(resourceGroupName: string, cacheName: string, options?: PrivateEndpointConnectionsListOptionalParams): PagedAsyncIterableIterator; +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions { } // @public -export interface PrivateEndpointConnectionsDeleteOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions { } // @public -export interface PrivateEndpointConnectionsGetOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions { } // @public -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -// @public -export interface PrivateEndpointConnectionsListOptionalParams extends coreClient.OperationOptions { +export interface PrivateEndpointConnectionsOperations { + delete: (resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsDeleteOptionalParams) => Promise; + get: (resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, options?: PrivateEndpointConnectionsGetOptionalParams) => Promise; + list: (resourceGroupName: string, cacheName: string, options?: PrivateEndpointConnectionsListOptionalParams) => PagedAsyncIterableIterator; + put: (resourceGroupName: string, cacheName: string, privateEndpointConnectionName: string, properties: PrivateEndpointConnection, options?: PrivateEndpointConnectionsPutOptionalParams) => PollerLike, PrivateEndpointConnection>; } // @public -export type PrivateEndpointConnectionsListResponse = PrivateEndpointConnectionListResult; - -// @public -export interface PrivateEndpointConnectionsPutOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface PrivateEndpointConnectionsPutOptionalParams extends OperationOptions { updateIntervalInMs?: number; } -// @public -export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection; - // @public export type PrivateEndpointServiceConnectionStatus = string; // @public export interface PrivateLinkResource extends Resource { - readonly groupId?: string; - readonly requiredMembers?: string[]; - requiredZoneNames?: string[]; + properties?: PrivateLinkResourceProperties; } // @public -export interface PrivateLinkResourceListResult { - value?: PrivateLinkResource[]; +export interface PrivateLinkResourceProperties { + readonly groupId?: string; + readonly requiredMembers?: string[]; + requiredZoneNames?: string[]; } // @public -export interface PrivateLinkResources { - listByRedisCache(resourceGroupName: string, cacheName: string, options?: PrivateLinkResourcesListByRedisCacheOptionalParams): PagedAsyncIterableIterator; +export interface PrivateLinkResourcesListByRedisCacheOptionalParams extends OperationOptions { } // @public -export interface PrivateLinkResourcesListByRedisCacheOptionalParams extends coreClient.OperationOptions { +export interface PrivateLinkResourcesOperations { + listByRedisCache: (resourceGroupName: string, cacheName: string, options?: PrivateLinkResourcesListByRedisCacheOptionalParams) => PagedAsyncIterableIterator; } -// @public -export type PrivateLinkResourcesListByRedisCacheResponse = PrivateLinkResourceListResult; - // @public export interface PrivateLinkServiceConnectionState { actionsRequired?: string; @@ -618,30 +507,6 @@ export type PublicNetworkAccess = string; // @public export type RebootType = string; -// @public -export interface Redis { - beginCreate(resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): Promise, RedisCreateResponse>>; - beginCreateAndWait(resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams): Promise; - beginDelete(resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): Promise, void>>; - beginDeleteAndWait(resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams): Promise; - beginExportData(resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): Promise, void>>; - beginExportDataAndWait(resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams): Promise; - beginFlushCache(resourceGroupName: string, cacheName: string, options?: RedisFlushCacheOptionalParams): Promise, RedisFlushCacheResponse>>; - beginFlushCacheAndWait(resourceGroupName: string, cacheName: string, options?: RedisFlushCacheOptionalParams): Promise; - beginImportData(resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): Promise, void>>; - beginImportDataAndWait(resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams): Promise; - beginUpdate(resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): Promise, RedisUpdateResponse>>; - beginUpdateAndWait(resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams): Promise; - checkNameAvailability(parameters: CheckNameAvailabilityParameters, options?: RedisCheckNameAvailabilityOptionalParams): Promise; - forceReboot(resourceGroupName: string, name: string, parameters: RedisRebootParameters, options?: RedisForceRebootOptionalParams): Promise; - get(resourceGroupName: string, name: string, options?: RedisGetOptionalParams): Promise; - listByResourceGroup(resourceGroupName: string, options?: RedisListByResourceGroupOptionalParams): PagedAsyncIterableIterator; - listBySubscription(options?: RedisListBySubscriptionOptionalParams): PagedAsyncIterableIterator; - listKeys(resourceGroupName: string, name: string, options?: RedisListKeysOptionalParams): Promise; - listUpgradeNotifications(resourceGroupName: string, name: string, history: number, options?: RedisListUpgradeNotificationsOptionalParams): PagedAsyncIterableIterator; - regenerateKey(resourceGroupName: string, name: string, parameters: RedisRegenerateKeyParameters, options?: RedisRegenerateKeyOptionalParams): Promise; -} - // @public export interface RedisAccessKeys { readonly primaryKey?: string; @@ -650,33 +515,31 @@ export interface RedisAccessKeys { // @public export interface RedisCacheAccessPolicy extends ProxyResource { - permissions?: string; - readonly provisioningState?: AccessPolicyProvisioningState; - readonly typePropertiesType?: AccessPolicyType; + properties?: RedisCacheAccessPolicyProperties; } // @public export interface RedisCacheAccessPolicyAssignment extends ProxyResource { - accessPolicyName?: string; - objectId?: string; - objectIdAlias?: string; - readonly provisioningState?: AccessPolicyAssignmentProvisioningState; + properties?: RedisCacheAccessPolicyAssignmentProperties; } // @public -export interface RedisCacheAccessPolicyAssignmentList { - readonly nextLink?: string; - value?: RedisCacheAccessPolicyAssignment[]; +export interface RedisCacheAccessPolicyAssignmentProperties { + accessPolicyName: string; + objectId: string; + objectIdAlias: string; + readonly provisioningState?: AccessPolicyAssignmentProvisioningState; } // @public -export interface RedisCacheAccessPolicyList { - readonly nextLink?: string; - value?: RedisCacheAccessPolicy[]; +export interface RedisCacheAccessPolicyProperties { + permissions: string; + readonly provisioningState?: AccessPolicyProvisioningState; + readonly type?: AccessPolicyType; } // @public -export interface RedisCheckNameAvailabilityOptionalParams extends coreClient.OperationOptions { +export interface RedisCheckNameAvailabilityOptionalParams extends OperationOptions { } // @public @@ -690,17 +553,15 @@ export interface RedisCommonProperties { replicasPerMaster?: number; replicasPerPrimary?: number; shardCount?: number; - tenantSettings?: { - [propertyName: string]: string; - }; + tenantSettings?: Record; updateChannel?: UpdateChannel; zonalAllocationPolicy?: ZonalAllocationPolicy; } // @public export interface RedisCommonPropertiesRedisConfiguration { - [property: string]: any; aadEnabled?: string; + additionalProperties?: Record; aofBackupEnabled?: string; aofStorageConnectionString0?: string; aofStorageConnectionString1?: string; @@ -722,35 +583,16 @@ export interface RedisCommonPropertiesRedisConfiguration { } // @public -export interface RedisCreateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisCreateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public export interface RedisCreateParameters { - disableAccessKeyAuthentication?: boolean; - enableNonSslPort?: boolean; identity?: ManagedServiceIdentity; location: string; - minimumTlsVersion?: TlsVersion; - publicNetworkAccess?: PublicNetworkAccess; - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - redisVersion?: string; - replicasPerMaster?: number; - replicasPerPrimary?: number; - shardCount?: number; - sku: Sku; - staticIP?: string; - subnetId?: string; - tags?: { - [propertyName: string]: string; - }; - tenantSettings?: { - [propertyName: string]: string; - }; - updateChannel?: UpdateChannel; - zonalAllocationPolicy?: ZonalAllocationPolicy; + properties: RedisCreateProperties; + tags?: Record; zones?: string[]; } @@ -762,56 +604,33 @@ export interface RedisCreateProperties extends RedisCommonProperties { } // @public -export type RedisCreateResponse = RedisResource; - -// @public -export interface RedisDeleteOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisDeleteOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export interface RedisExportDataOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisExportDataOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public export interface RedisFirewallRule extends ProxyResource { - endIP: string; - startIP: string; -} - -// @public -export interface RedisFirewallRuleCreateParameters extends RedisFirewallRule { + properties: RedisFirewallRuleProperties; } // @public -export interface RedisFirewallRuleListResult { - readonly nextLink?: string; - value?: RedisFirewallRule[]; -} - -// @public -export interface RedisFlushCacheHeaders { - azureAsyncOperation?: string; - location?: string; +export interface RedisFirewallRuleProperties { + endIP: string; + startIP: string; } // @public -export interface RedisFlushCacheOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisFlushCacheOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public -export type RedisFlushCacheResponse = RedisFlushCacheHeaders & OperationStatusResult; - -// @public -export type RedisForceRebootOperationResponse = RedisForceRebootResponse; - -// @public -export interface RedisForceRebootOptionalParams extends coreClient.OperationOptions { +export interface RedisForceRebootOptionalParams extends OperationOptions { } // @public @@ -820,15 +639,11 @@ export interface RedisForceRebootResponse { } // @public -export interface RedisGetOptionalParams extends coreClient.OperationOptions { +export interface RedisGetOptionalParams extends OperationOptions { } // @public -export type RedisGetResponse = RedisResource; - -// @public -export interface RedisImportDataOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisImportDataOptionalParams extends OperationOptions { updateIntervalInMs?: number; } @@ -852,11 +667,7 @@ export interface RedisLinkedServer { // @public export interface RedisLinkedServerCreateParameters { - readonly geoReplicatedPrimaryHostName?: string; - linkedRedisCacheId: string; - linkedRedisCacheLocation: string; - readonly primaryHostName?: string; - serverRole: ReplicationRole; + properties: RedisLinkedServerCreateProperties; } // @public @@ -875,123 +686,69 @@ export interface RedisLinkedServerProperties extends RedisLinkedServerCreateProp // @public export interface RedisLinkedServerWithProperties extends ProxyResource { - readonly geoReplicatedPrimaryHostName?: string; - linkedRedisCacheId?: string; - linkedRedisCacheLocation?: string; - readonly primaryHostName?: string; - readonly provisioningState?: string; - serverRole?: ReplicationRole; -} - -// @public -export interface RedisLinkedServerWithPropertiesList { - readonly nextLink?: string; - value?: RedisLinkedServerWithProperties[]; -} - -// @public -export interface RedisListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type RedisListByResourceGroupNextResponse = RedisListResult; - -// @public -export interface RedisListByResourceGroupOptionalParams extends coreClient.OperationOptions { + properties?: RedisLinkedServerProperties; } // @public -export type RedisListByResourceGroupResponse = RedisListResult; - -// @public -export interface RedisListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { +export interface RedisListByResourceGroupOptionalParams extends OperationOptions { } // @public -export type RedisListBySubscriptionNextResponse = RedisListResult; - -// @public -export interface RedisListBySubscriptionOptionalParams extends coreClient.OperationOptions { +export interface RedisListBySubscriptionOptionalParams extends OperationOptions { } // @public -export type RedisListBySubscriptionResponse = RedisListResult; - -// @public -export interface RedisListKeysOptionalParams extends coreClient.OperationOptions { +export interface RedisListKeysOptionalParams extends OperationOptions { } // @public -export type RedisListKeysResponse = RedisAccessKeys; - -// @public -export interface RedisListResult { - readonly nextLink?: string; - value?: RedisResource[]; +export interface RedisListUpgradeNotificationsOptionalParams extends OperationOptions { } -// @public -export interface RedisListUpgradeNotificationsNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type RedisListUpgradeNotificationsNextResponse = NotificationListResponse; - -// @public -export interface RedisListUpgradeNotificationsOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type RedisListUpgradeNotificationsResponse = NotificationListResponse; - // @public (undocumented) -export class RedisManagementClient extends coreClient.ServiceClient { - // (undocumented) - $host: string; - constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: RedisManagementClientOptionalParams); - // (undocumented) - accessPolicy: AccessPolicy; - // (undocumented) - accessPolicyAssignment: AccessPolicyAssignment; - // (undocumented) - apiVersion: string; - // (undocumented) - asyncOperationStatus: AsyncOperationStatus; - // (undocumented) - firewallRules: FirewallRules; - // (undocumented) - linkedServer: LinkedServer; - // (undocumented) - operations: Operations; - // (undocumented) - patchSchedules: PatchSchedules; - // (undocumented) - privateEndpointConnections: PrivateEndpointConnections; - // (undocumented) - privateLinkResources: PrivateLinkResources; - // (undocumented) - redis: Redis; - // (undocumented) - subscriptionId: string; -} - -// @public -export interface RedisManagementClientOptionalParams extends coreClient.ServiceClientOptions { - $host?: string; +export class RedisManagementClient { + constructor(credential: TokenCredential, subscriptionId: string, options?: RedisManagementClientOptionalParams); + readonly accessPolicy: AccessPolicyOperations; + readonly accessPolicyAssignment: AccessPolicyAssignmentOperations; + readonly asyncOperationStatus: AsyncOperationStatusOperations; + readonly firewallRules: FirewallRulesOperations; + readonly linkedServer: LinkedServerOperations; + readonly operations: OperationsOperations; + readonly patchSchedules: PatchSchedulesOperations; + readonly pipeline: Pipeline; + readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + readonly privateLinkResources: PrivateLinkResourcesOperations; + readonly redis: RedisOperations; +} + +// @public +export interface RedisManagementClientOptionalParams extends ClientOptions { apiVersion?: string; - endpoint?: string; + cloudSetting?: AzureSupportedClouds; } // @public -export interface RedisPatchSchedule extends ProxyResource { - readonly location?: string; - scheduleEntries: ScheduleEntry[]; +export interface RedisOperations { + checkNameAvailability: (parameters: CheckNameAvailabilityParameters, options?: RedisCheckNameAvailabilityOptionalParams) => Promise; + create: (resourceGroupName: string, name: string, parameters: RedisCreateParameters, options?: RedisCreateOptionalParams) => PollerLike, RedisResource>; + delete: (resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams) => PollerLike, void>; + exportData: (resourceGroupName: string, name: string, parameters: ExportRDBParameters, options?: RedisExportDataOptionalParams) => PollerLike, void>; + flushCache: (resourceGroupName: string, cacheName: string, options?: RedisFlushCacheOptionalParams) => PollerLike, OperationStatusResult>; + forceReboot: (resourceGroupName: string, name: string, parameters: RedisRebootParameters, options?: RedisForceRebootOptionalParams) => Promise; + get: (resourceGroupName: string, name: string, options?: RedisGetOptionalParams) => Promise; + importData: (resourceGroupName: string, name: string, parameters: ImportRDBParameters, options?: RedisImportDataOptionalParams) => PollerLike, void>; + listByResourceGroup: (resourceGroupName: string, options?: RedisListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; + listBySubscription: (options?: RedisListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; + listKeys: (resourceGroupName: string, name: string, options?: RedisListKeysOptionalParams) => Promise; + listUpgradeNotifications: (resourceGroupName: string, name: string, history: number, options?: RedisListUpgradeNotificationsOptionalParams) => PagedAsyncIterableIterator; + regenerateKey: (resourceGroupName: string, name: string, parameters: RedisRegenerateKeyParameters, options?: RedisRegenerateKeyOptionalParams) => Promise; + update: (resourceGroupName: string, name: string, parameters: RedisUpdateParameters, options?: RedisUpdateOptionalParams) => PollerLike, RedisResource>; } // @public -export interface RedisPatchScheduleListResult { - readonly nextLink?: string; - value?: RedisPatchSchedule[]; +export interface RedisPatchSchedule extends ProxyResource { + readonly location?: string; + properties: ScheduleEntries; } // @public @@ -1014,7 +771,7 @@ export interface RedisRebootParameters { } // @public -export interface RedisRegenerateKeyOptionalParams extends coreClient.OperationOptions { +export interface RedisRegenerateKeyOptionalParams extends OperationOptions { } // @public @@ -1022,67 +779,23 @@ export interface RedisRegenerateKeyParameters { keyType: RedisKeyType; } -// @public -export type RedisRegenerateKeyResponse = RedisAccessKeys; - // @public export interface RedisResource extends TrackedResource { - readonly accessKeys?: RedisAccessKeys; - disableAccessKeyAuthentication?: boolean; - enableNonSslPort?: boolean; - readonly hostName?: string; identity?: ManagedServiceIdentity; - readonly instances?: RedisInstanceDetails[]; - readonly linkedServers?: RedisLinkedServer[]; - minimumTlsVersion?: TlsVersion; - readonly port?: number; - readonly privateEndpointConnections?: PrivateEndpointConnection[]; - readonly provisioningState?: ProvisioningState; - publicNetworkAccess?: PublicNetworkAccess; - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - redisVersion?: string; - replicasPerMaster?: number; - replicasPerPrimary?: number; - shardCount?: number; - sku: Sku; - readonly sslPort?: number; - staticIP?: string; - subnetId?: string; - tenantSettings?: { - [propertyName: string]: string; - }; - updateChannel?: UpdateChannel; - zonalAllocationPolicy?: ZonalAllocationPolicy; + properties: RedisProperties; zones?: string[]; } // @public -export interface RedisUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; +export interface RedisUpdateOptionalParams extends OperationOptions { updateIntervalInMs?: number; } // @public export interface RedisUpdateParameters { - disableAccessKeyAuthentication?: boolean; - enableNonSslPort?: boolean; identity?: ManagedServiceIdentity; - minimumTlsVersion?: TlsVersion; - publicNetworkAccess?: PublicNetworkAccess; - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - redisVersion?: string; - replicasPerMaster?: number; - replicasPerPrimary?: number; - shardCount?: number; - sku?: Sku; - tags?: { - [propertyName: string]: string; - }; - tenantSettings?: { - [propertyName: string]: string; - }; - updateChannel?: UpdateChannel; - zonalAllocationPolicy?: ZonalAllocationPolicy; + properties?: RedisUpdateProperties; + tags?: Record; } // @public @@ -1090,9 +803,6 @@ export interface RedisUpdateProperties extends RedisCommonProperties { sku?: Sku; } -// @public -export type RedisUpdateResponse = RedisResource; - // @public export type ReplicationRole = "Primary" | "Secondary"; @@ -1100,9 +810,25 @@ export type ReplicationRole = "Primary" | "Secondary"; export interface Resource { readonly id?: string; readonly name?: string; + readonly systemData?: SystemData; readonly type?: string; } +// @public +export function restorePoller(client: RedisManagementClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; + +// @public (undocumented) +export interface RestorePollerOptions extends OperationOptions { + abortSignal?: AbortSignalLike; + processResponseBody?: (result: TResponse) => Promise; + updateIntervalInMs?: number; +} + +// @public +export interface ScheduleEntries { + scheduleEntries: ScheduleEntry[]; +} + // @public export interface ScheduleEntry { dayOfWeek: DayOfWeek; @@ -1123,15 +849,23 @@ export type SkuFamily = string; // @public export type SkuName = string; +// @public +export interface SystemData { + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; +} + // @public export type TlsVersion = string; // @public export interface TrackedResource extends Resource { location: string; - tags?: { - [propertyName: string]: string; - }; + tags?: Record; } // @public @@ -1141,9 +875,7 @@ export type UpdateChannel = string; export interface UpgradeNotification { readonly name?: string; readonly timestamp?: Date; - readonly upsellNotification?: { - [propertyName: string]: string; - }; + readonly upsellNotification?: Record; } // @public diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentCreateUpdateSample.ts index 89a24ddbcfc7..6f0641fb8391 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentCreateUpdateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentCreateUpdateSample.ts @@ -1,35 +1,30 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Adds the access policy assignment to the specified users - * - * @summary Adds the access policy assignment to the specified users - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json - */ - -import type { RedisCacheAccessPolicyAssignment } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to adds the access policy assignment to the specified users + * + * @summary adds the access policy assignment to the specified users + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentCreateUpdate.json + */ async function redisCacheAccessPolicyAssignmentCreateUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const parameters: RedisCacheAccessPolicyAssignment = { - accessPolicyName: "accessPolicy1", - objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", - objectIdAlias: "TestAADAppRedis", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - parameters, + const result = await client.accessPolicyAssignment.createUpdate( + "rg1", + "cache1", + "accessPolicyAssignmentName1", + { + properties: { + accessPolicyName: "accessPolicy1", + objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", + objectIdAlias: "TestAADAppRedis", + }, + }, ); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentDeleteSample.ts index 5cfa72d5207b..39544fdcd139 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the access policy assignment from a redis cache - * - * @summary Deletes the access policy assignment from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the access policy assignment from a redis cache + * + * @summary deletes the access policy assignment from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentDelete.json + */ async function redisCacheAccessPolicyAssignmentDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - ); - console.log(result); + await client.accessPolicyAssignment.delete("rg1", "cache1", "accessPolicyAssignmentName1"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentGetSample.ts index fe9499949863..8b9153ecde96 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentGetSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the list of assignments for an access policy of a redis cache - * - * @summary Gets the list of assignments for an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the list of assignments for an access policy of a redis cache + * + * @summary gets the list of assignments for an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentGet.json + */ async function redisCacheAccessPolicyAssignmentGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const result = await client.accessPolicyAssignment.get( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, + "rg1", + "cache1", + "accessPolicyAssignmentName1", ); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentListSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentListSample.ts index 95c823d15838..6aab702ccd3e 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyAssignmentListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the list of access policy assignments associated with this redis cache - * - * @summary Gets the list of access policy assignments associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the list of access policy assignments associated with this redis cache + * + * @summary gets the list of access policy assignments associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentList.json + */ async function redisCacheAccessPolicyAssignmentList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.accessPolicyAssignment.list(resourceGroupName, cacheName)) { + for await (const item of client.accessPolicyAssignment.list("rg1", "cache1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyCreateUpdateSample.ts index ab4e48f1a8f4..11ea12876c6a 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyCreateUpdateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyCreateUpdateSample.ts @@ -1,32 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Adds an access policy to the redis cache - * - * @summary Adds an access policy to the redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json - */ - -import type { RedisCacheAccessPolicy } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to adds an access policy to the redis cache + * + * @summary adds an access policy to the redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyCreateUpdate.json + */ async function redisCacheAccessPolicyCreateUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const parameters: RedisCacheAccessPolicy = { permissions: "+get +hget" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - parameters, - ); + const result = await client.accessPolicy.createUpdate("rg1", "cache1", "accessPolicy1", { + properties: { permissions: "+get +hget" }, + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyDeleteSample.ts index 7bc7e2d19615..8c1a17765a02 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the access policy from a redis cache - * - * @summary Deletes the access policy from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the access policy from a redis cache + * + * @summary deletes the access policy from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyDelete.json + */ async function redisCacheAccessPolicyDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - ); - console.log(result); + await client.accessPolicy.delete("rg1", "cache1", "accessPolicy1"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyGetSample.ts index f03b73eed857..2a0dc14f4510 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyGetSample.ts @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the detailed information about an access policy of a redis cache - * - * @summary Gets the detailed information about an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the detailed information about an access policy of a redis cache + * + * @summary gets the detailed information about an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyGet.json + */ async function redisCacheAccessPolicyGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.get(resourceGroupName, cacheName, accessPolicyName); + const result = await client.accessPolicy.get("rg1", "cache1", "accessPolicy1"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/accessPolicyListSample.ts b/sdk/redis/arm-rediscache/samples-dev/accessPolicyListSample.ts index 775bc557ed60..4e1eabee9a81 100644 --- a/sdk/redis/arm-rediscache/samples-dev/accessPolicyListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/accessPolicyListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the list of access policies associated with this redis cache - * - * @summary Gets the list of access policies associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the list of access policies associated with this redis cache + * + * @summary gets the list of access policies associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyList.json + */ async function redisCacheAccessPolicyList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.accessPolicy.list(resourceGroupName, cacheName)) { + for await (const item of client.accessPolicy.list("rg1", "cache1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/asyncOperationStatusGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/asyncOperationStatusGetSample.ts index 98118d2a468b..cd1a7dd08e84 100644 --- a/sdk/redis/arm-rediscache/samples-dev/asyncOperationStatusGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/asyncOperationStatusGetSample.ts @@ -1,24 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to For checking the ongoing status of an operation - * - * @summary For checking the ongoing status of an operation - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to for checking the ongoing status of an operation + * + * @summary for checking the ongoing status of an operation + * x-ms-original-file: 2024-11-01/RedisCacheAsyncOperationStatus.json + */ async function redisCacheAsyncOperationStatus(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const location = "East US"; - const operationId = "c7ba2bf5-5939-4d79-b037-2964ccf097da"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.asyncOperationStatus.get(location, operationId); + const result = await client.asyncOperationStatus.get( + "East US", + "c7ba2bf5-5939-4d79-b037-2964ccf097da", + ); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/firewallRulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples-dev/firewallRulesCreateOrUpdateSample.ts index c309ddfc58f8..fa11b71eec98 100644 --- a/sdk/redis/arm-rediscache/samples-dev/firewallRulesCreateOrUpdateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/firewallRulesCreateOrUpdateSample.ts @@ -1,35 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Create or update a redis cache firewall rule - * - * @summary Create or update a redis cache firewall rule - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json - */ - -import type { RedisFirewallRule } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to create or update a redis cache firewall rule + * + * @summary create or update a redis cache firewall rule + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleCreate.json + */ async function redisCacheFirewallRuleCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const parameters: RedisFirewallRule = { - endIP: "192.168.1.4", - startIP: "192.168.1.1", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.createOrUpdate( - resourceGroupName, - cacheName, - ruleName, - parameters, - ); + const result = await client.firewallRules.createOrUpdate("rg1", "cache1", "rule1", { + properties: { endIP: "192.168.1.4", startIP: "192.168.1.1" }, + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/firewallRulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/firewallRulesDeleteSample.ts index 135fb4fe7930..15143cbe7171 100644 --- a/sdk/redis/arm-rediscache/samples-dev/firewallRulesDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/firewallRulesDeleteSample.ts @@ -1,26 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a single firewall rule in a specified redis cache. - * - * @summary Deletes a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes a single firewall rule in a specified redis cache. + * + * @summary deletes a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleDelete.json + */ async function redisCacheFirewallRuleDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.delete(resourceGroupName, cacheName, ruleName); - console.log(result); + await client.firewallRules.delete("rg1", "cache1", "rule1"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/firewallRulesGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/firewallRulesGetSample.ts index 6133be330fa2..da07cae38355 100644 --- a/sdk/redis/arm-rediscache/samples-dev/firewallRulesGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/firewallRulesGetSample.ts @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a single firewall rule in a specified redis cache. - * - * @summary Gets a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets a single firewall rule in a specified redis cache. + * + * @summary gets a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleGet.json + */ async function redisCacheFirewallRuleGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.get(resourceGroupName, cacheName, ruleName); + const result = await client.firewallRules.get("rg1", "cache1", "rule1"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/firewallRulesListSample.ts b/sdk/redis/arm-rediscache/samples-dev/firewallRulesListSample.ts index 1fa3b1101417..4e98cb812908 100644 --- a/sdk/redis/arm-rediscache/samples-dev/firewallRulesListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/firewallRulesListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets all firewall rules in the specified redis cache. - * - * @summary Gets all firewall rules in the specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets all firewall rules in the specified redis cache. + * + * @summary gets all firewall rules in the specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRulesList.json + */ async function redisCacheFirewallRulesList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.firewallRules.list(resourceGroupName, cacheName)) { + for await (const item of client.firewallRules.list("rg1", "cache1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/linkedServerCreateSample.ts b/sdk/redis/arm-rediscache/samples-dev/linkedServerCreateSample.ts index 46c398e46120..7fe36bf18e32 100644 --- a/sdk/redis/arm-rediscache/samples-dev/linkedServerCreateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/linkedServerCreateSample.ts @@ -1,37 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Adds a linked server to the Redis cache (requires Premium SKU). - * - * @summary Adds a linked server to the Redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json - */ - -import type { RedisLinkedServerCreateParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to adds a linked server to the Redis cache (requires Premium SKU). + * + * @summary adds a linked server to the Redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Create.json + */ async function linkedServerCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const parameters: RedisLinkedServerCreateParameters = { - linkedRedisCacheId: - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", - linkedRedisCacheLocation: "West US", - serverRole: "Secondary", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginCreateAndWait( - resourceGroupName, - name, - linkedServerName, - parameters, - ); + const result = await client.linkedServer.create("rg1", "cache1", "cache2", { + properties: { + linkedRedisCacheId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", + linkedRedisCacheLocation: "West US", + serverRole: "Secondary", + }, + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/linkedServerDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/linkedServerDeleteSample.ts index 22252c8f18ec..5ea0a94285ba 100644 --- a/sdk/redis/arm-rediscache/samples-dev/linkedServerDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/linkedServerDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the linked server from a redis cache (requires Premium SKU). - * - * @summary Deletes the linked server from a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the linked server from a redis cache (requires Premium SKU). + * + * @summary deletes the linked server from a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Delete.json + */ async function linkedServerDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginDeleteAndWait( - resourceGroupName, - name, - linkedServerName, - ); - console.log(result); + await client.linkedServer.delete("rg1", "cache1", "cache2"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/linkedServerGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/linkedServerGetSample.ts index 7cc95ea0a506..24638a3aedbc 100644 --- a/sdk/redis/arm-rediscache/samples-dev/linkedServerGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/linkedServerGetSample.ts @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @summary Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @summary gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Get.json + */ async function linkedServerGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.get(resourceGroupName, name, linkedServerName); + const result = await client.linkedServer.get("rg1", "cache1", "cache2"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/linkedServerListSample.ts b/sdk/redis/arm-rediscache/samples-dev/linkedServerListSample.ts index cbb158c52f22..2c50323f5a50 100644 --- a/sdk/redis/arm-rediscache/samples-dev/linkedServerListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/linkedServerListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * - * @summary Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @summary gets the list of linked servers associated with this redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_List.json + */ async function linkedServerList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.linkedServer.list(resourceGroupName, name)) { + for await (const item of client.linkedServer.list("rg1", "cache1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/operationsListSample.ts b/sdk/redis/arm-rediscache/samples-dev/operationsListSample.ts index 7e5ce6b3b434..b505dde74a5e 100644 --- a/sdk/redis/arm-rediscache/samples-dev/operationsListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/operationsListSample.ts @@ -1,26 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider. - * - * @summary Lists all of the available REST API operations of the Microsoft.Cache provider. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheOperations.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2024-11-01/RedisCacheOperations.json + */ async function redisCacheOperations(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.operations.list()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesCreateOrUpdateSample.ts index 2241a380d213..319e69dd9676 100644 --- a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesCreateOrUpdateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesCreateOrUpdateSample.ts @@ -1,37 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Create or replace the patching schedule for Redis cache. - * - * @summary Create or replace the patching schedule for Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json - */ - -import type { RedisPatchSchedule } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to create or replace the patching schedule for Redis cache. + * + * @summary create or replace the patching schedule for Redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesCreateOrUpdate.json + */ async function redisCachePatchSchedulesCreateOrUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const parameters: RedisPatchSchedule = { - scheduleEntries: [ - { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, - { dayOfWeek: "Tuesday", startHourUtc: 12 }, - ], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.createOrUpdate( - resourceGroupName, - name, - defaultParam, - parameters, - ); + const result = await client.patchSchedules.createOrUpdate("rg1", "cache1", "default", { + properties: { + scheduleEntries: [ + { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, + { dayOfWeek: "Tuesday", startHourUtc: 12 }, + ], + }, + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesDeleteSample.ts index 1422d63818e4..f493a683ad23 100644 --- a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesDeleteSample.ts @@ -1,26 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the patching schedule of a redis cache. - * - * @summary Deletes the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the patching schedule of a redis cache. + * + * @summary deletes the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesDelete.json + */ async function redisCachePatchSchedulesDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.delete(resourceGroupName, name, defaultParam); - console.log(result); + await client.patchSchedules.delete("rg1", "cache1", "default"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesGetSample.ts index c96ad212c4d4..888936e7e50d 100644 --- a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesGetSample.ts @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the patching schedule of a redis cache. - * - * @summary Gets the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the patching schedule of a redis cache. + * + * @summary gets the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesGet.json + */ async function redisCachePatchSchedulesGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.get(resourceGroupName, name, defaultParam); + const result = await client.patchSchedules.get("rg1", "cache1", "default"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesListByRedisResourceSample.ts b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesListByRedisResourceSample.ts index c03f1e604086..a0b360e78d49 100644 --- a/sdk/redis/arm-rediscache/samples-dev/patchSchedulesListByRedisResourceSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/patchSchedulesListByRedisResourceSample.ts @@ -1,30 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets all patch schedules in the specified redis cache (there is only one). - * - * @summary Gets all patch schedules in the specified redis cache (there is only one). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets all patch schedules in the specified redis cache (there is only one). + * + * @summary gets all patch schedules in the specified redis cache (there is only one). + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesList.json + */ async function redisCachePatchSchedulesList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.patchSchedules.listByRedisResource( - resourceGroupName, - cacheName, - )) { + for await (const item of client.patchSchedules.listByRedisResource("rg1", "cache1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsDeleteSample.ts index 06492ffdb21e..944f73827bb5 100644 --- a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -1,30 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the redis cache. - * - * @summary Deletes the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the redis cache. + * + * @summary deletes the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDeletePrivateEndpointConnection.json + */ async function redisCacheDeletePrivateEndpointConnection(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - ); - console.log(result); + await client.privateEndpointConnections.delete("rgtest01", "cachetest01", "pectest01"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsGetSample.ts index 7522342a5863..e3a25211512d 100644 --- a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsGetSample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the redis cache. - * - * @summary Gets the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the redis cache. + * + * @summary gets the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheGetPrivateEndpointConnection.json + */ async function redisCacheGetPrivateEndpointConnection(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const result = await client.privateEndpointConnections.get( - resourceGroupName, - cacheName, - privateEndpointConnectionName, + "rgtest01", + "cachetest01", + "pectest01", ); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsListSample.ts index 283cb42c27ea..45e2abc24d86 100644 --- a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsListSample.ts @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to List all the private endpoint connections associated with the redis cache. - * - * @summary List all the private endpoint connections associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to list all the private endpoint connections associated with the redis cache. + * + * @summary list all the private endpoint connections associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateEndpointConnections.json + */ async function redisCacheListPrivateEndpointConnection(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.privateEndpointConnections.list(resourceGroupName, cacheName)) { + for await (const item of client.privateEndpointConnections.list("rgtest01", "cachetest01")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsPutSample.ts b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsPutSample.ts index ab366be4a000..bdf092ed550f 100644 --- a/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsPutSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/privateEndpointConnectionsPutSample.ts @@ -1,36 +1,31 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the redis cache. - * - * @summary Update the state of specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json - */ - -import type { PrivateEndpointConnection } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the redis cache. + * + * @summary update the state of specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePutPrivateEndpointConnection.json + */ async function redisCachePutPrivateEndpointConnection(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const properties: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved", - }, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginPutAndWait( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - properties, + const result = await client.privateEndpointConnections.put( + "rgtest01", + "cachetest01", + "pectest01", + { + properties: { + privateLinkServiceConnectionState: { + description: "Auto-Approved", + status: "Approved", + }, + }, + }, ); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/privateLinkResourcesListByRedisCacheSample.ts b/sdk/redis/arm-rediscache/samples-dev/privateLinkResourcesListByRedisCacheSample.ts index 1c0352451744..73cdbf382940 100644 --- a/sdk/redis/arm-rediscache/samples-dev/privateLinkResourcesListByRedisCacheSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/privateLinkResourcesListByRedisCacheSample.ts @@ -1,30 +1,27 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a redis cache. - * - * @summary Gets the private link resources that need to be created for a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets the private link resources that need to be created for a redis cache. + * + * @summary gets the private link resources that need to be created for a redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateLinkResources.json + */ async function storageAccountListPrivateLinkResources(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cacheTest01"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.privateLinkResources.listByRedisCache( - resourceGroupName, - cacheName, + "rgtest01", + "cacheTest01", )) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisCheckNameAvailabilitySample.ts b/sdk/redis/arm-rediscache/samples-dev/redisCheckNameAvailabilitySample.ts index bae215e2a132..baf2194a26a2 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisCheckNameAvailabilitySample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisCheckNameAvailabilitySample.ts @@ -1,28 +1,23 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Checks that the redis cache name is valid and is not already in use. - * - * @summary Checks that the redis cache name is valid and is not already in use. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json - */ - -import type { CheckNameAvailabilityParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to checks that the redis cache name is valid and is not already in use. + * + * @summary checks that the redis cache name is valid and is not already in use. + * x-ms-original-file: 2024-11-01/RedisCacheCheckNameAvailability.json + */ async function redisCacheCheckNameAvailability(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const parameters: CheckNameAvailabilityParameters = { - name: "cacheName", - type: "Microsoft.Cache/Redis", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.checkNameAvailability(parameters); - console.log(result); + await client.redis.checkNameAvailability({ + name: "cacheName", + type: "Microsoft.Cache/Redis", + }); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/redisCreateSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisCreateSample.ts index 7f1798cab0d4..f62c9d216f69 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisCreateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisCreateSample.ts @@ -1,187 +1,178 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json - */ - -import type { RedisCreateParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreate.json + */ async function redisCacheCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "4", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "4", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); console.log(result); } /** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateAutomaticZonalAllocationPolicy.json + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateAutomaticZonalAllocationPolicy.json */ async function redisCacheCreateAutomaticZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "Automatic", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "Automatic", + }, + }); console.log(result); } /** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateDefaultVersion.json + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateDefaultVersion.json */ async function redisCacheCreateDefaultVersion(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); console.log(result); } /** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateLatestVersion.json + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateLatestVersion.json */ async function redisCacheCreateLatestVersion(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); console.log(result); } /** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateNoZonesZonalAllocationPolicy.json + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateNoZonesZonalAllocationPolicy.json */ async function redisCacheCreateNoZonesZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "NoZones", - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "NoZones", + }, + }); console.log(result); } /** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateUserDefinedZonalAllocationPolicy.json + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateUserDefinedZonalAllocationPolicy.json */ async function redisCacheCreateUserDefinedZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "UserDefined", - zones: ["1"], - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "UserDefined", + }, + zones: ["1"], + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisDeleteSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisDeleteSample.ts index 5b1ea761dd20..e1dc594dd728 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisDeleteSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisDeleteSample.ts @@ -1,25 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes a Redis cache. - * - * @summary Deletes a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes a Redis cache. + * + * @summary deletes a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDelete.json + */ async function redisCacheDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginDeleteAndWait(resourceGroupName, name); - console.log(result); + await client.redis.delete("rg1", "cache1"); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/redisExportDataSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisExportDataSample.ts index dea0d1d5727b..b53bafe137ad 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisExportDataSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisExportDataSample.ts @@ -1,32 +1,25 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Export data from the redis cache to blobs in a container. - * - * @summary Export data from the redis cache to blobs in a container. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json - */ - -import type { ExportRDBParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to export data from the redis cache to blobs in a container. + * + * @summary export data from the redis cache to blobs in a container. + * x-ms-original-file: 2024-11-01/RedisCacheExport.json + */ async function redisCacheExport(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: ExportRDBParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.exportData("rg1", "cache1", { format: "RDB", container: "https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters", prefix: "datadump1", storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginExportDataAndWait(resourceGroupName, name, parameters); - console.log(result); + }); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/redisFlushCacheSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisFlushCacheSample.ts index 975df436a9dd..4d2436f04b21 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisFlushCacheSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisFlushCacheSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Deletes all of the keys in a cache. - * - * @summary Deletes all of the keys in a cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to deletes all of the keys in a cache. + * + * @summary deletes all of the keys in a cache. + * x-ms-original-file: 2024-11-01/RedisCacheFlush.json + */ async function redisCacheFlush(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subcription-id"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "resource-group-name"; - const cacheName = "cache-name"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginFlushCacheAndWait(resourceGroupName, cacheName); + const result = await client.redis.flushCache("resource-group-name", "cache-name"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisForceRebootSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisForceRebootSample.ts index 98decdf73638..3d70342df6e0 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisForceRebootSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisForceRebootSample.ts @@ -1,30 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * - * @summary Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json - */ - -import type { RedisRebootParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * + * @summary reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * x-ms-original-file: 2024-11-01/RedisCacheForceReboot.json + */ async function redisCacheForceReboot(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisRebootParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.forceReboot("rg1", "cache1", { ports: [13000, 15001], rebootType: "AllNodes", shardId: 0, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.forceReboot(resourceGroupName, name, parameters); + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisGetSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisGetSample.ts index 74cd1cad0507..10e7b84f3dc4 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisGetSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisGetSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets a Redis cache (resource description). - * - * @summary Gets a Redis cache (resource description). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets a Redis cache (resource description). + * + * @summary gets a Redis cache (resource description). + * x-ms-original-file: 2024-11-01/RedisCacheGet.json + */ async function redisCacheGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.get(resourceGroupName, name); + const result = await client.redis.get("rg1", "cache1"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisImportDataSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisImportDataSample.ts index c8e16d8ef313..9beaec88dbd1 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisImportDataSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisImportDataSample.ts @@ -1,31 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Import data into Redis cache. - * - * @summary Import data into Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json - */ - -import type { ImportRDBParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to import data into Redis cache. + * + * @summary import data into Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheImport.json + */ async function redisCacheImport(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: ImportRDBParameters = { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.importData("rg1", "cache1", { format: "RDB", files: ["http://fileuris.contoso.com/pathtofile1"], storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginImportDataAndWait(resourceGroupName, name, parameters); - console.log(result); + }); } async function main(): Promise { diff --git a/sdk/redis/arm-rediscache/samples-dev/redisListByResourceGroupSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisListByResourceGroupSample.ts index d64f9aadfc11..d69074118bc1 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisListByResourceGroupSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisListByResourceGroupSample.ts @@ -1,26 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Lists all Redis caches in a resource group. - * - * @summary Lists all Redis caches in a resource group. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to lists all Redis caches in a resource group. + * + * @summary lists all Redis caches in a resource group. + * x-ms-original-file: 2024-11-01/RedisCacheListByResourceGroup.json + */ async function redisCacheListByResourceGroup(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.redis.listByResourceGroup(resourceGroupName)) { + for await (const item of client.redis.listByResourceGroup("rg1")) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisListBySubscriptionSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisListBySubscriptionSample.ts index 27688e3551aa..596ed21f8549 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisListBySubscriptionSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisListBySubscriptionSample.ts @@ -1,25 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets all Redis caches in the specified subscription. - * - * @summary Gets all Redis caches in the specified subscription. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to gets all Redis caches in the specified subscription. + * + * @summary gets all Redis caches in the specified subscription. + * x-ms-original-file: 2024-11-01/RedisCacheList.json + */ async function redisCacheList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); for await (const item of client.redis.listBySubscription()) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisListKeysSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisListKeysSample.ts index 81bdd22c1a68..d20380d96698 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisListKeysSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisListKeysSample.ts @@ -1,24 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheListKeys.json + */ async function redisCacheListKeys(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.listKeys(resourceGroupName, name); + const result = await client.redis.listKeys("rg1", "cache1"); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisListUpgradeNotificationsSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisListUpgradeNotificationsSample.ts index 029d5b227f32..a67bdff1f624 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisListUpgradeNotificationsSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisListUpgradeNotificationsSample.ts @@ -1,32 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Gets any upgrade notifications for a Redis cache. - * - * @summary Gets any upgrade notifications for a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json - */ - import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to [Deprecated] Gets any upgrade notifications for a Redis cache. + * + * @summary [Deprecated] Gets any upgrade notifications for a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListUpgradeNotifications.json + */ async function redisCacheListUpgradeNotifications(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const history = 5000; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.redis.listUpgradeNotifications( - resourceGroupName, - name, - history, - )) { + for await (const item of client.redis.listUpgradeNotifications("rg1", "cache1", 5000)) { resArray.push(item); } + console.log(resArray); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisRegenerateKeySample.ts b/sdk/redis/arm-rediscache/samples-dev/redisRegenerateKeySample.ts index ba926b52795b..dd28dbcd5ae2 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisRegenerateKeySample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisRegenerateKeySample.ts @@ -1,26 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json - */ - -import type { RedisRegenerateKeyParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheRegenerateKey.json + */ async function redisCacheRegenerateKey(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisRegenerateKeyParameters = { keyType: "Primary" }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.regenerateKey(resourceGroupName, name, parameters); + const result = await client.redis.regenerateKey("rg1", "cache1", { + keyType: "Primary", + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples-dev/redisUpdateSample.ts b/sdk/redis/arm-rediscache/samples-dev/redisUpdateSample.ts index d5a1965f0670..c08fab28453a 100644 --- a/sdk/redis/arm-rediscache/samples-dev/redisUpdateSample.ts +++ b/sdk/redis/arm-rediscache/samples-dev/redisUpdateSample.ts @@ -1,29 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** - * This sample demonstrates how to Update an existing Redis cache. - * - * @summary Update an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json - */ - -import type { RedisUpdateParameters } from "@azure/arm-rediscache"; import { RedisManagementClient } from "@azure/arm-rediscache"; import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; +/** + * This sample demonstrates how to update an existing Redis cache. + * + * @summary update an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheUpdate.json + */ async function redisCacheUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisUpdateParameters = { - enableNonSslPort: true, - replicasPerPrimary: 2, - }; const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginUpdateAndWait(resourceGroupName, name, parameters); + const result = await client.redis.update("rg1", "cache1", { + properties: { enableNonSslPort: true, replicasPerPrimary: 2 }, + }); console.log(result); } diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/README.md b/sdk/redis/arm-rediscache/samples/v8/javascript/README.md deleted file mode 100644 index d1bd87ff84e8..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/README.md +++ /dev/null @@ -1,130 +0,0 @@ -# client library samples for JavaScript - -These sample programs show how to use the JavaScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accessPolicyAssignmentCreateUpdateSample.js][accesspolicyassignmentcreateupdatesample] | Adds the access policy assignment to the specified users x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json | -| [accessPolicyAssignmentDeleteSample.js][accesspolicyassignmentdeletesample] | Deletes the access policy assignment from a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json | -| [accessPolicyAssignmentGetSample.js][accesspolicyassignmentgetsample] | Gets the list of assignments for an access policy of a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json | -| [accessPolicyAssignmentListSample.js][accesspolicyassignmentlistsample] | Gets the list of access policy assignments associated with this redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json | -| [accessPolicyCreateUpdateSample.js][accesspolicycreateupdatesample] | Adds an access policy to the redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json | -| [accessPolicyDeleteSample.js][accesspolicydeletesample] | Deletes the access policy from a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json | -| [accessPolicyGetSample.js][accesspolicygetsample] | Gets the detailed information about an access policy of a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json | -| [accessPolicyListSample.js][accesspolicylistsample] | Gets the list of access policies associated with this redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json | -| [asyncOperationStatusGetSample.js][asyncoperationstatusgetsample] | For checking the ongoing status of an operation x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json | -| [firewallRulesCreateOrUpdateSample.js][firewallrulescreateorupdatesample] | Create or update a redis cache firewall rule x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json | -| [firewallRulesDeleteSample.js][firewallrulesdeletesample] | Deletes a single firewall rule in a specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json | -| [firewallRulesGetSample.js][firewallrulesgetsample] | Gets a single firewall rule in a specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json | -| [firewallRulesListSample.js][firewallruleslistsample] | Gets all firewall rules in the specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json | -| [linkedServerCreateSample.js][linkedservercreatesample] | Adds a linked server to the Redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json | -| [linkedServerDeleteSample.js][linkedserverdeletesample] | Deletes the linked server from a redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json | -| [linkedServerGetSample.js][linkedservergetsample] | Gets the detailed information about a linked server of a redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json | -| [linkedServerListSample.js][linkedserverlistsample] | Gets the list of linked servers associated with this redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json | -| [operationsListSample.js][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Cache provider. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheOperations.json | -| [patchSchedulesCreateOrUpdateSample.js][patchschedulescreateorupdatesample] | Create or replace the patching schedule for Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json | -| [patchSchedulesDeleteSample.js][patchschedulesdeletesample] | Deletes the patching schedule of a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json | -| [patchSchedulesGetSample.js][patchschedulesgetsample] | Gets the patching schedule of a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json | -| [patchSchedulesListByRedisResourceSample.js][patchscheduleslistbyredisresourcesample] | Gets all patch schedules in the specified redis cache (there is only one). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all the private endpoint connections associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json | -| [privateEndpointConnectionsPutSample.js][privateendpointconnectionsputsample] | Update the state of specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json | -| [privateLinkResourcesListByRedisCacheSample.js][privatelinkresourceslistbyrediscachesample] | Gets the private link resources that need to be created for a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json | -| [redisCheckNameAvailabilitySample.js][redischecknameavailabilitysample] | Checks that the redis cache name is valid and is not already in use. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json | -| [redisCreateSample.js][rediscreatesample] | Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json | -| [redisDeleteSample.js][redisdeletesample] | Deletes a Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json | -| [redisExportDataSample.js][redisexportdatasample] | Export data from the redis cache to blobs in a container. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json | -| [redisFlushCacheSample.js][redisflushcachesample] | Deletes all of the keys in a cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json | -| [redisForceRebootSample.js][redisforcerebootsample] | Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json | -| [redisGetSample.js][redisgetsample] | Gets a Redis cache (resource description). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json | -| [redisImportDataSample.js][redisimportdatasample] | Import data into Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json | -| [redisListByResourceGroupSample.js][redislistbyresourcegroupsample] | Lists all Redis caches in a resource group. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json | -| [redisListBySubscriptionSample.js][redislistbysubscriptionsample] | Gets all Redis caches in the specified subscription. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json | -| [redisListKeysSample.js][redislistkeyssample] | Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json | -| [redisListUpgradeNotificationsSample.js][redislistupgradenotificationssample] | Gets any upgrade notifications for a Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json | -| [redisRegenerateKeySample.js][redisregeneratekeysample] | Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json | -| [redisUpdateSample.js][redisupdatesample] | Update an existing Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -3. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node accessPolicyAssignmentCreateUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -cross-env REDIS_SUBSCRIPTION_ID="" REDIS_RESOURCE_GROUP="" node accessPolicyAssignmentCreateUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accesspolicyassignmentcreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentCreateUpdateSample.js -[accesspolicyassignmentdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentDeleteSample.js -[accesspolicyassignmentgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentGetSample.js -[accesspolicyassignmentlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentListSample.js -[accesspolicycreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyCreateUpdateSample.js -[accesspolicydeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyDeleteSample.js -[accesspolicygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyGetSample.js -[accesspolicylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyListSample.js -[asyncoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/asyncOperationStatusGetSample.js -[firewallrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesCreateOrUpdateSample.js -[firewallrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesDeleteSample.js -[firewallrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesGetSample.js -[firewallruleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesListSample.js -[linkedservercreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerCreateSample.js -[linkedserverdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerDeleteSample.js -[linkedservergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerGetSample.js -[linkedserverlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerListSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/operationsListSample.js -[patchschedulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesCreateOrUpdateSample.js -[patchschedulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesDeleteSample.js -[patchschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesGetSample.js -[patchscheduleslistbyredisresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesListByRedisResourceSample.js -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsDeleteSample.js -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsGetSample.js -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsListSample.js -[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsPutSample.js -[privatelinkresourceslistbyrediscachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/privateLinkResourcesListByRedisCacheSample.js -[redischecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisCheckNameAvailabilitySample.js -[rediscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisCreateSample.js -[redisdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisDeleteSample.js -[redisexportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisExportDataSample.js -[redisflushcachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisFlushCacheSample.js -[redisforcerebootsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisForceRebootSample.js -[redisgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisGetSample.js -[redisimportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisImportDataSample.js -[redislistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisListByResourceGroupSample.js -[redislistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisListBySubscriptionSample.js -[redislistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisListKeysSample.js -[redislistupgradenotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisListUpgradeNotificationsSample.js -[redisregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisRegenerateKeySample.js -[redisupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/javascript/redisUpdateSample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/README.md diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentCreateUpdateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentCreateUpdateSample.js deleted file mode 100644 index 51b7157d4569..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentCreateUpdateSample.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Adds the access policy assignment to the specified users - * - * @summary Adds the access policy assignment to the specified users - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json - */ -async function redisCacheAccessPolicyAssignmentCreateUpdate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const parameters = { - accessPolicyName: "accessPolicy1", - objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", - objectIdAlias: "TestAADAppRedis", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - parameters, - ); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyAssignmentCreateUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentDeleteSample.js deleted file mode 100644 index 7fb89983252d..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the access policy assignment from a redis cache - * - * @summary Deletes the access policy assignment from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json - */ -async function redisCacheAccessPolicyAssignmentDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - ); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyAssignmentDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentGetSample.js deleted file mode 100644 index 986a833aab85..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of assignments for an access policy of a redis cache - * - * @summary Gets the list of assignments for an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json - */ -async function redisCacheAccessPolicyAssignmentGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.get( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - ); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyAssignmentGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentListSample.js deleted file mode 100644 index ec0489176a9c..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyAssignmentListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of access policy assignments associated with this redis cache - * - * @summary Gets the list of access policy assignments associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json - */ -async function redisCacheAccessPolicyAssignmentList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessPolicyAssignment.list(resourceGroupName, cacheName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheAccessPolicyAssignmentList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyCreateUpdateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyCreateUpdateSample.js deleted file mode 100644 index 95c1eb8a35d3..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyCreateUpdateSample.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Adds an access policy to the redis cache - * - * @summary Adds an access policy to the redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json - */ -async function redisCacheAccessPolicyCreateUpdate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const parameters = { permissions: "+get +hget" }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - parameters, - ); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyCreateUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyDeleteSample.js deleted file mode 100644 index 149d21648f89..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the access policy from a redis cache - * - * @summary Deletes the access policy from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json - */ -async function redisCacheAccessPolicyDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - ); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyGetSample.js deleted file mode 100644 index 06093c2dc842..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the detailed information about an access policy of a redis cache - * - * @summary Gets the detailed information about an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json - */ -async function redisCacheAccessPolicyGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.get(resourceGroupName, cacheName, accessPolicyName); - console.log(result); -} - -async function main() { - await redisCacheAccessPolicyGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyListSample.js deleted file mode 100644 index 8cbd133155bf..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/accessPolicyListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of access policies associated with this redis cache - * - * @summary Gets the list of access policies associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json - */ -async function redisCacheAccessPolicyList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessPolicy.list(resourceGroupName, cacheName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheAccessPolicyList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/asyncOperationStatusGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/asyncOperationStatusGetSample.js deleted file mode 100644 index 0a6eebdf72e1..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/asyncOperationStatusGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to For checking the ongoing status of an operation - * - * @summary For checking the ongoing status of an operation - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json - */ -async function redisCacheAsyncOperationStatus() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const location = "East US"; - const operationId = "c7ba2bf5-5939-4d79-b037-2964ccf097da"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.asyncOperationStatus.get(location, operationId); - console.log(result); -} - -async function main() { - await redisCacheAsyncOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesCreateOrUpdateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesCreateOrUpdateSample.js deleted file mode 100644 index a1ac92c29913..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesCreateOrUpdateSample.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or update a redis cache firewall rule - * - * @summary Create or update a redis cache firewall rule - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json - */ -async function redisCacheFirewallRuleCreate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const parameters = { - endIP: "192.168.1.4", - startIP: "192.168.1.1", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.createOrUpdate( - resourceGroupName, - cacheName, - ruleName, - parameters, - ); - console.log(result); -} - -async function main() { - await redisCacheFirewallRuleCreate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesDeleteSample.js deleted file mode 100644 index cad8f3fe9249..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a single firewall rule in a specified redis cache. - * - * @summary Deletes a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json - */ -async function redisCacheFirewallRuleDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.delete(resourceGroupName, cacheName, ruleName); - console.log(result); -} - -async function main() { - await redisCacheFirewallRuleDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesGetSample.js deleted file mode 100644 index e81e165169fa..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a single firewall rule in a specified redis cache. - * - * @summary Gets a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json - */ -async function redisCacheFirewallRuleGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.get(resourceGroupName, cacheName, ruleName); - console.log(result); -} - -async function main() { - await redisCacheFirewallRuleGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesListSample.js deleted file mode 100644 index d6b6f3e310bb..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/firewallRulesListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets all firewall rules in the specified redis cache. - * - * @summary Gets all firewall rules in the specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json - */ -async function redisCacheFirewallRulesList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.firewallRules.list(resourceGroupName, cacheName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheFirewallRulesList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerCreateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerCreateSample.js deleted file mode 100644 index c5a4126ecb89..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerCreateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Adds a linked server to the Redis cache (requires Premium SKU). - * - * @summary Adds a linked server to the Redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json - */ -async function linkedServerCreate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const parameters = { - linkedRedisCacheId: - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", - linkedRedisCacheLocation: "West US", - serverRole: "Secondary", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginCreateAndWait( - resourceGroupName, - name, - linkedServerName, - parameters, - ); - console.log(result); -} - -async function main() { - await linkedServerCreate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerDeleteSample.js deleted file mode 100644 index fed7218797ab..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the linked server from a redis cache (requires Premium SKU). - * - * @summary Deletes the linked server from a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json - */ -async function linkedServerDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginDeleteAndWait( - resourceGroupName, - name, - linkedServerName, - ); - console.log(result); -} - -async function main() { - await linkedServerDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerGetSample.js deleted file mode 100644 index acc198c2b7ff..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @summary Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json - */ -async function linkedServerGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.get(resourceGroupName, name, linkedServerName); - console.log(result); -} - -async function main() { - await linkedServerGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerListSample.js deleted file mode 100644 index 15ad84b03006..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/linkedServerListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * - * @summary Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json - */ -async function linkedServerList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.linkedServer.list(resourceGroupName, name)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await linkedServerList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/operationsListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/operationsListSample.js deleted file mode 100644 index b7296e107b3b..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider. - * - * @summary Lists all of the available REST API operations of the Microsoft.Cache provider. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheOperations.json - */ -async function redisCacheOperations() { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheOperations(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesCreateOrUpdateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesCreateOrUpdateSample.js deleted file mode 100644 index c5b520178c8e..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesCreateOrUpdateSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or replace the patching schedule for Redis cache. - * - * @summary Create or replace the patching schedule for Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json - */ -async function redisCachePatchSchedulesCreateOrUpdate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const parameters = { - scheduleEntries: [ - { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, - { dayOfWeek: "Tuesday", startHourUtc: 12 }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.createOrUpdate( - resourceGroupName, - name, - defaultParam, - parameters, - ); - console.log(result); -} - -async function main() { - await redisCachePatchSchedulesCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesDeleteSample.js deleted file mode 100644 index 196fe4ecb37e..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesDeleteSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the patching schedule of a redis cache. - * - * @summary Deletes the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json - */ -async function redisCachePatchSchedulesDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.delete(resourceGroupName, name, defaultParam); - console.log(result); -} - -async function main() { - await redisCachePatchSchedulesDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesGetSample.js deleted file mode 100644 index d8eff5a073db..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesGetSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the patching schedule of a redis cache. - * - * @summary Gets the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json - */ -async function redisCachePatchSchedulesGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.get(resourceGroupName, name, defaultParam); - console.log(result); -} - -async function main() { - await redisCachePatchSchedulesGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesListByRedisResourceSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesListByRedisResourceSample.js deleted file mode 100644 index 128b5a2c6df0..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/patchSchedulesListByRedisResourceSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets all patch schedules in the specified redis cache (there is only one). - * - * @summary Gets all patch schedules in the specified redis cache (there is only one). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json - */ -async function redisCachePatchSchedulesList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.patchSchedules.listByRedisResource(resourceGroupName, cacheName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCachePatchSchedulesList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsDeleteSample.js deleted file mode 100644 index c8b822af4dd9..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsDeleteSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the redis cache. - * - * @summary Deletes the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json - */ -async function redisCacheDeletePrivateEndpointConnection() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await redisCacheDeletePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsGetSample.js deleted file mode 100644 index 84bcfe322410..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsGetSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the redis cache. - * - * @summary Gets the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json - */ -async function redisCacheGetPrivateEndpointConnection() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main() { - await redisCacheGetPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsListSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsListSample.js deleted file mode 100644 index 4bfdf600dc3c..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsListSample.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to List all the private endpoint connections associated with the redis cache. - * - * @summary List all the private endpoint connections associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json - */ -async function redisCacheListPrivateEndpointConnection() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list(resourceGroupName, cacheName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheListPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsPutSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsPutSample.js deleted file mode 100644 index f31de08dff96..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/privateEndpointConnectionsPutSample.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the redis cache. - * - * @summary Update the state of specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json - */ -async function redisCachePutPrivateEndpointConnection() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const properties = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginPutAndWait( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - properties, - ); - console.log(result); -} - -async function main() { - await redisCachePutPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/privateLinkResourcesListByRedisCacheSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/privateLinkResourcesListByRedisCacheSample.js deleted file mode 100644 index d68da4e83fcb..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/privateLinkResourcesListByRedisCacheSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a redis cache. - * - * @summary Gets the private link resources that need to be created for a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json - */ -async function storageAccountListPrivateLinkResources() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cacheTest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkResources.listByRedisCache( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await storageAccountListPrivateLinkResources(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisCheckNameAvailabilitySample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisCheckNameAvailabilitySample.js deleted file mode 100644 index 0e2cea5954d6..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisCheckNameAvailabilitySample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Checks that the redis cache name is valid and is not already in use. - * - * @summary Checks that the redis cache name is valid and is not already in use. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json - */ -async function redisCacheCheckNameAvailability() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const parameters = { - name: "cacheName", - type: "Microsoft.Cache/Redis", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.checkNameAvailability(parameters); - console.log(result); -} - -async function main() { - await redisCacheCheckNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisCreateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisCreateSample.js deleted file mode 100644 index f503f2f567cb..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisCreateSample.js +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json - */ -async function redisCacheCreate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "4", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateAutomaticZonalAllocationPolicy.json - */ -async function redisCacheCreateAutomaticZonalAllocationPolicy() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "Automatic", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateDefaultVersion.json - */ -async function redisCacheCreateDefaultVersion() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateLatestVersion.json - */ -async function redisCacheCreateLatestVersion() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateNoZonesZonalAllocationPolicy.json - */ -async function redisCacheCreateNoZonesZonalAllocationPolicy() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "NoZones", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateUserDefinedZonalAllocationPolicy.json - */ -async function redisCacheCreateUserDefinedZonalAllocationPolicy() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "UserDefined", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheCreate(); - await redisCacheCreateAutomaticZonalAllocationPolicy(); - await redisCacheCreateDefaultVersion(); - await redisCacheCreateLatestVersion(); - await redisCacheCreateNoZonesZonalAllocationPolicy(); - await redisCacheCreateUserDefinedZonalAllocationPolicy(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisDeleteSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisDeleteSample.js deleted file mode 100644 index 96e3f7821d76..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisDeleteSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes a Redis cache. - * - * @summary Deletes a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json - */ -async function redisCacheDelete() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginDeleteAndWait(resourceGroupName, name); - console.log(result); -} - -async function main() { - await redisCacheDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisExportDataSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisExportDataSample.js deleted file mode 100644 index 295820923883..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisExportDataSample.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Export data from the redis cache to blobs in a container. - * - * @summary Export data from the redis cache to blobs in a container. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json - */ -async function redisCacheExport() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - format: "RDB", - container: "https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters", - prefix: "datadump1", - storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginExportDataAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheExport(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisFlushCacheSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisFlushCacheSample.js deleted file mode 100644 index 4d150abdaf9d..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisFlushCacheSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Deletes all of the keys in a cache. - * - * @summary Deletes all of the keys in a cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json - */ -async function redisCacheFlush() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subcription-id"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "resource-group-name"; - const cacheName = "cache-name"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginFlushCacheAndWait(resourceGroupName, cacheName); - console.log(result); -} - -async function main() { - await redisCacheFlush(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisForceRebootSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisForceRebootSample.js deleted file mode 100644 index 048c38165f8c..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisForceRebootSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * - * @summary Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json - */ -async function redisCacheForceReboot() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - ports: [13000, 15001], - rebootType: "AllNodes", - shardId: 0, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.forceReboot(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheForceReboot(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisGetSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisGetSample.js deleted file mode 100644 index e98344acf4e0..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisGetSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets a Redis cache (resource description). - * - * @summary Gets a Redis cache (resource description). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json - */ -async function redisCacheGet() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.get(resourceGroupName, name); - console.log(result); -} - -async function main() { - await redisCacheGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisImportDataSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisImportDataSample.js deleted file mode 100644 index e9d4e0737bd3..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisImportDataSample.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Import data into Redis cache. - * - * @summary Import data into Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json - */ -async function redisCacheImport() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - format: "RDB", - files: ["http://fileuris.contoso.com/pathtofile1"], - storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginImportDataAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheImport(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListByResourceGroupSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisListByResourceGroupSample.js deleted file mode 100644 index b58885c3d46a..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListByResourceGroupSample.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Lists all Redis caches in a resource group. - * - * @summary Lists all Redis caches in a resource group. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json - */ -async function redisCacheListByResourceGroup() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListBySubscriptionSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisListBySubscriptionSample.js deleted file mode 100644 index c631a9fdd772..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListBySubscriptionSample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets all Redis caches in the specified subscription. - * - * @summary Gets all Redis caches in the specified subscription. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json - */ -async function redisCacheList() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListKeysSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisListKeysSample.js deleted file mode 100644 index 70ddbda62aa9..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListKeysSample.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json - */ -async function redisCacheListKeys() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.listKeys(resourceGroupName, name); - console.log(result); -} - -async function main() { - await redisCacheListKeys(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListUpgradeNotificationsSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisListUpgradeNotificationsSample.js deleted file mode 100644 index c78cd07268ec..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisListUpgradeNotificationsSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Gets any upgrade notifications for a Redis cache. - * - * @summary Gets any upgrade notifications for a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json - */ -async function redisCacheListUpgradeNotifications() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const history = 5000; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listUpgradeNotifications(resourceGroupName, name, history)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - await redisCacheListUpgradeNotifications(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisRegenerateKeySample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisRegenerateKeySample.js deleted file mode 100644 index 6be1a61a2f31..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisRegenerateKeySample.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json - */ -async function redisCacheRegenerateKey() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { keyType: "Primary" }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.regenerateKey(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheRegenerateKey(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/redisUpdateSample.js b/sdk/redis/arm-rediscache/samples/v8/javascript/redisUpdateSample.js deleted file mode 100644 index 018a13c3dbfa..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/redisUpdateSample.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { RedisManagementClient } = require("@azure/arm-rediscache"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv/config"); - -/** - * This sample demonstrates how to Update an existing Redis cache. - * - * @summary Update an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json - */ -async function redisCacheUpdate() { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters = { - enableNonSslPort: true, - replicasPerPrimary: 2, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginUpdateAndWait(resourceGroupName, name, parameters); - console.log(result); -} - -async function main() { - await redisCacheUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/README.md b/sdk/redis/arm-rediscache/samples/v8/typescript/README.md deleted file mode 100644 index 6fad0e5c44de..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/README.md +++ /dev/null @@ -1,143 +0,0 @@ -# client library samples for TypeScript - -These sample programs show how to use the TypeScript client libraries for in some common scenarios. - -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accessPolicyAssignmentCreateUpdateSample.ts][accesspolicyassignmentcreateupdatesample] | Adds the access policy assignment to the specified users x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json | -| [accessPolicyAssignmentDeleteSample.ts][accesspolicyassignmentdeletesample] | Deletes the access policy assignment from a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json | -| [accessPolicyAssignmentGetSample.ts][accesspolicyassignmentgetsample] | Gets the list of assignments for an access policy of a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json | -| [accessPolicyAssignmentListSample.ts][accesspolicyassignmentlistsample] | Gets the list of access policy assignments associated with this redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json | -| [accessPolicyCreateUpdateSample.ts][accesspolicycreateupdatesample] | Adds an access policy to the redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json | -| [accessPolicyDeleteSample.ts][accesspolicydeletesample] | Deletes the access policy from a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json | -| [accessPolicyGetSample.ts][accesspolicygetsample] | Gets the detailed information about an access policy of a redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json | -| [accessPolicyListSample.ts][accesspolicylistsample] | Gets the list of access policies associated with this redis cache x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json | -| [asyncOperationStatusGetSample.ts][asyncoperationstatusgetsample] | For checking the ongoing status of an operation x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json | -| [firewallRulesCreateOrUpdateSample.ts][firewallrulescreateorupdatesample] | Create or update a redis cache firewall rule x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json | -| [firewallRulesDeleteSample.ts][firewallrulesdeletesample] | Deletes a single firewall rule in a specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json | -| [firewallRulesGetSample.ts][firewallrulesgetsample] | Gets a single firewall rule in a specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json | -| [firewallRulesListSample.ts][firewallruleslistsample] | Gets all firewall rules in the specified redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json | -| [linkedServerCreateSample.ts][linkedservercreatesample] | Adds a linked server to the Redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json | -| [linkedServerDeleteSample.ts][linkedserverdeletesample] | Deletes the linked server from a redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json | -| [linkedServerGetSample.ts][linkedservergetsample] | Gets the detailed information about a linked server of a redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json | -| [linkedServerListSample.ts][linkedserverlistsample] | Gets the list of linked servers associated with this redis cache (requires Premium SKU). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json | -| [operationsListSample.ts][operationslistsample] | Lists all of the available REST API operations of the Microsoft.Cache provider. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheOperations.json | -| [patchSchedulesCreateOrUpdateSample.ts][patchschedulescreateorupdatesample] | Create or replace the patching schedule for Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json | -| [patchSchedulesDeleteSample.ts][patchschedulesdeletesample] | Deletes the patching schedule of a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json | -| [patchSchedulesGetSample.ts][patchschedulesgetsample] | Gets the patching schedule of a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json | -| [patchSchedulesListByRedisResourceSample.ts][patchscheduleslistbyredisresourcesample] | Gets all patch schedules in the specified redis cache (there is only one). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes the specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Gets the specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all the private endpoint connections associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json | -| [privateEndpointConnectionsPutSample.ts][privateendpointconnectionsputsample] | Update the state of specified private endpoint connection associated with the redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json | -| [privateLinkResourcesListByRedisCacheSample.ts][privatelinkresourceslistbyrediscachesample] | Gets the private link resources that need to be created for a redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json | -| [redisCheckNameAvailabilitySample.ts][redischecknameavailabilitysample] | Checks that the redis cache name is valid and is not already in use. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json | -| [redisCreateSample.ts][rediscreatesample] | Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json | -| [redisDeleteSample.ts][redisdeletesample] | Deletes a Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json | -| [redisExportDataSample.ts][redisexportdatasample] | Export data from the redis cache to blobs in a container. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json | -| [redisFlushCacheSample.ts][redisflushcachesample] | Deletes all of the keys in a cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json | -| [redisForceRebootSample.ts][redisforcerebootsample] | Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json | -| [redisGetSample.ts][redisgetsample] | Gets a Redis cache (resource description). x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json | -| [redisImportDataSample.ts][redisimportdatasample] | Import data into Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json | -| [redisListByResourceGroupSample.ts][redislistbyresourcegroupsample] | Lists all Redis caches in a resource group. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json | -| [redisListBySubscriptionSample.ts][redislistbysubscriptionsample] | Gets all Redis caches in the specified subscription. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json | -| [redisListKeysSample.ts][redislistkeyssample] | Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json | -| [redisListUpgradeNotificationsSample.ts][redislistupgradenotificationssample] | Gets any upgrade notifications for a Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json | -| [redisRegenerateKeySample.ts][redisregeneratekeysample] | Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json | -| [redisUpdateSample.ts][redisupdatesample] | Update an existing Redis cache. x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: - -```bash -npm install -g typescript -``` - -You need [an Azure subscription][freesub] to run these sample programs. - -Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. - -Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. - -## Setup - -To run the samples using the published version of the package: - -1. Install the dependencies using `npm`: - -```bash -npm install -``` - -2. Compile the samples: - -```bash -npm run build -``` - -3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. - -4. Run whichever samples you like (note that some samples may require additional setup, see the table above): - -```bash -node dist/accessPolicyAssignmentCreateUpdateSample.js -``` - -Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): - -```bash -cross-env REDIS_SUBSCRIPTION_ID="" REDIS_RESOURCE_GROUP="" node dist/accessPolicyAssignmentCreateUpdateSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[accesspolicyassignmentcreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts -[accesspolicyassignmentdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentDeleteSample.ts -[accesspolicyassignmentgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentGetSample.ts -[accesspolicyassignmentlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentListSample.ts -[accesspolicycreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyCreateUpdateSample.ts -[accesspolicydeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyDeleteSample.ts -[accesspolicygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyGetSample.ts -[accesspolicylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyListSample.ts -[asyncoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/asyncOperationStatusGetSample.ts -[firewallrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesCreateOrUpdateSample.ts -[firewallrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesDeleteSample.ts -[firewallrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesGetSample.ts -[firewallruleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesListSample.ts -[linkedservercreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerCreateSample.ts -[linkedserverdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerDeleteSample.ts -[linkedservergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerGetSample.ts -[linkedserverlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerListSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/operationsListSample.ts -[patchschedulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesCreateOrUpdateSample.ts -[patchschedulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesDeleteSample.ts -[patchschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesGetSample.ts -[patchscheduleslistbyredisresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesListByRedisResourceSample.ts -[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsDeleteSample.ts -[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsGetSample.ts -[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsListSample.ts -[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsPutSample.ts -[privatelinkresourceslistbyrediscachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateLinkResourcesListByRedisCacheSample.ts -[redischecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCheckNameAvailabilitySample.ts -[rediscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCreateSample.ts -[redisdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisDeleteSample.ts -[redisexportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisExportDataSample.ts -[redisflushcachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisFlushCacheSample.ts -[redisforcerebootsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisForceRebootSample.ts -[redisgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisGetSample.ts -[redisimportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisImportDataSample.ts -[redislistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListByResourceGroupSample.ts -[redislistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListBySubscriptionSample.ts -[redislistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListKeysSample.ts -[redislistupgradenotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListUpgradeNotificationsSample.ts -[redisregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisRegenerateKeySample.ts -[redisupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisUpdateSample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts deleted file mode 100644 index 56f71f1504f4..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisCacheAccessPolicyAssignment, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Adds the access policy assignment to the specified users - * - * @summary Adds the access policy assignment to the specified users - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentCreateUpdate.json - */ -async function redisCacheAccessPolicyAssignmentCreateUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const parameters: RedisCacheAccessPolicyAssignment = { - accessPolicyName: "accessPolicy1", - objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", - objectIdAlias: "TestAADAppRedis", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyAssignmentCreateUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentDeleteSample.ts deleted file mode 100644 index 27899fe92c71..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the access policy assignment from a redis cache - * - * @summary Deletes the access policy assignment from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentDelete.json - */ -async function redisCacheAccessPolicyAssignmentDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyAssignmentDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentGetSample.ts deleted file mode 100644 index 3d22f8243ba0..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of assignments for an access policy of a redis cache - * - * @summary Gets the list of assignments for an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentGet.json - */ -async function redisCacheAccessPolicyAssignmentGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyAssignmentName = "accessPolicyAssignmentName1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicyAssignment.get( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyAssignmentGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentListSample.ts deleted file mode 100644 index e21830f15d6b..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyAssignmentListSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of access policy assignments associated with this redis cache - * - * @summary Gets the list of access policy assignments associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyAssignmentList.json - */ -async function redisCacheAccessPolicyAssignmentList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessPolicyAssignment.list( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheAccessPolicyAssignmentList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyCreateUpdateSample.ts deleted file mode 100644 index b34059beec24..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyCreateUpdateSample.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisCacheAccessPolicy, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Adds an access policy to the redis cache - * - * @summary Adds an access policy to the redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyCreateUpdate.json - */ -async function redisCacheAccessPolicyCreateUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const parameters: RedisCacheAccessPolicy = { permissions: "+get +hget" }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginCreateUpdateAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyCreateUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyDeleteSample.ts deleted file mode 100644 index 0970aed54d01..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the access policy from a redis cache - * - * @summary Deletes the access policy from a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyDelete.json - */ -async function redisCacheAccessPolicyDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.beginDeleteAndWait( - resourceGroupName, - cacheName, - accessPolicyName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyGetSample.ts deleted file mode 100644 index 1d0cf8a3823d..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the detailed information about an access policy of a redis cache - * - * @summary Gets the detailed information about an access policy of a redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyGet.json - */ -async function redisCacheAccessPolicyGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const accessPolicyName = "accessPolicy1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.accessPolicy.get( - resourceGroupName, - cacheName, - accessPolicyName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheAccessPolicyGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyListSample.ts deleted file mode 100644 index d15169cd9ba5..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/accessPolicyListSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of access policies associated with this redis cache - * - * @summary Gets the list of access policies associated with this redis cache - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAccessPolicyList.json - */ -async function redisCacheAccessPolicyList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.accessPolicy.list( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheAccessPolicyList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/asyncOperationStatusGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/asyncOperationStatusGetSample.ts deleted file mode 100644 index 0d5208e4df63..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/asyncOperationStatusGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to For checking the ongoing status of an operation - * - * @summary For checking the ongoing status of an operation - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheAsyncOperationStatus.json - */ -async function redisCacheAsyncOperationStatus(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const location = "East US"; - const operationId = "c7ba2bf5-5939-4d79-b037-2964ccf097da"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.asyncOperationStatus.get(location, operationId); - console.log(result); -} - -async function main(): Promise { - await redisCacheAsyncOperationStatus(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesCreateOrUpdateSample.ts deleted file mode 100644 index 8d30762fbc50..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisFirewallRule, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or update a redis cache firewall rule - * - * @summary Create or update a redis cache firewall rule - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleCreate.json - */ -async function redisCacheFirewallRuleCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const parameters: RedisFirewallRule = { - endIP: "192.168.1.4", - startIP: "192.168.1.1", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.createOrUpdate( - resourceGroupName, - cacheName, - ruleName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheFirewallRuleCreate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesDeleteSample.ts deleted file mode 100644 index 4f0509bef0d3..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a single firewall rule in a specified redis cache. - * - * @summary Deletes a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleDelete.json - */ -async function redisCacheFirewallRuleDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.delete( - resourceGroupName, - cacheName, - ruleName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheFirewallRuleDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesGetSample.ts deleted file mode 100644 index 113fef9a2357..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a single firewall rule in a specified redis cache. - * - * @summary Gets a single firewall rule in a specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRuleGet.json - */ -async function redisCacheFirewallRuleGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const ruleName = "rule1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.firewallRules.get( - resourceGroupName, - cacheName, - ruleName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheFirewallRuleGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesListSample.ts deleted file mode 100644 index 1b117694a42e..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/firewallRulesListSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets all firewall rules in the specified redis cache. - * - * @summary Gets all firewall rules in the specified redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFirewallRulesList.json - */ -async function redisCacheFirewallRulesList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.firewallRules.list( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheFirewallRulesList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerCreateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerCreateSample.ts deleted file mode 100644 index 06de7c635ed9..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerCreateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisLinkedServerCreateParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Adds a linked server to the Redis cache (requires Premium SKU). - * - * @summary Adds a linked server to the Redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Create.json - */ -async function linkedServerCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const parameters: RedisLinkedServerCreateParameters = { - linkedRedisCacheId: - "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", - linkedRedisCacheLocation: "West US", - serverRole: "Secondary", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginCreateAndWait( - resourceGroupName, - name, - linkedServerName, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await linkedServerCreate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerDeleteSample.ts deleted file mode 100644 index 1663ed2e53b3..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the linked server from a redis cache (requires Premium SKU). - * - * @summary Deletes the linked server from a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Delete.json - */ -async function linkedServerDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.beginDeleteAndWait( - resourceGroupName, - name, - linkedServerName, - ); - console.log(result); -} - -async function main(): Promise { - await linkedServerDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerGetSample.ts deleted file mode 100644 index 512241fa8748..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * - * @summary Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_Get.json - */ -async function linkedServerGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const linkedServerName = "cache2"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.linkedServer.get( - resourceGroupName, - name, - linkedServerName, - ); - console.log(result); -} - -async function main(): Promise { - await linkedServerGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerListSample.ts deleted file mode 100644 index 513d2fd8d557..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/linkedServerListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * - * @summary Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheLinkedServer_List.json - */ -async function linkedServerList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.linkedServer.list(resourceGroupName, name)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await linkedServerList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/operationsListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/operationsListSample.ts deleted file mode 100644 index 52c59f191579..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all of the available REST API operations of the Microsoft.Cache provider. - * - * @summary Lists all of the available REST API operations of the Microsoft.Cache provider. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheOperations.json - */ -async function redisCacheOperations(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheOperations(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesCreateOrUpdateSample.ts deleted file mode 100644 index c4909436aa3f..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisPatchSchedule, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or replace the patching schedule for Redis cache. - * - * @summary Create or replace the patching schedule for Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesCreateOrUpdate.json - */ -async function redisCachePatchSchedulesCreateOrUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const parameters: RedisPatchSchedule = { - scheduleEntries: [ - { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, - { dayOfWeek: "Tuesday", startHourUtc: 12 }, - ], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.createOrUpdate( - resourceGroupName, - name, - defaultParam, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCachePatchSchedulesCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesDeleteSample.ts deleted file mode 100644 index c4454c9f0d9a..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesDeleteSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the patching schedule of a redis cache. - * - * @summary Deletes the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesDelete.json - */ -async function redisCachePatchSchedulesDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.delete( - resourceGroupName, - name, - defaultParam, - ); - console.log(result); -} - -async function main(): Promise { - await redisCachePatchSchedulesDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesGetSample.ts deleted file mode 100644 index e28f400f3b41..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesGetSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the patching schedule of a redis cache. - * - * @summary Gets the patching schedule of a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesGet.json - */ -async function redisCachePatchSchedulesGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const defaultParam = "default"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.patchSchedules.get( - resourceGroupName, - name, - defaultParam, - ); - console.log(result); -} - -async function main(): Promise { - await redisCachePatchSchedulesGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesListByRedisResourceSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesListByRedisResourceSample.ts deleted file mode 100644 index a549517e62ad..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/patchSchedulesListByRedisResourceSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets all patch schedules in the specified redis cache (there is only one). - * - * @summary Gets all patch schedules in the specified redis cache (there is only one). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePatchSchedulesList.json - */ -async function redisCachePatchSchedulesList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const cacheName = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.patchSchedules.listByRedisResource( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCachePatchSchedulesList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsDeleteSample.ts deleted file mode 100644 index 58a730794cf8..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes the specified private endpoint connection associated with the redis cache. - * - * @summary Deletes the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDeletePrivateEndpointConnection.json - */ -async function redisCacheDeletePrivateEndpointConnection(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.delete( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheDeletePrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsGetSample.ts deleted file mode 100644 index 937d66c1bf41..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsGetSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the specified private endpoint connection associated with the redis cache. - * - * @summary Gets the specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGetPrivateEndpointConnection.json - */ -async function redisCacheGetPrivateEndpointConnection(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.get( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheGetPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsListSample.ts deleted file mode 100644 index 25744a42667f..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsListSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to List all the private endpoint connections associated with the redis cache. - * - * @summary List all the private endpoint connections associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateEndpointConnections.json - */ -async function redisCacheListPrivateEndpointConnection(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateEndpointConnections.list( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheListPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsPutSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsPutSample.ts deleted file mode 100644 index 40a938dd8f38..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateEndpointConnectionsPutSample.ts +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - PrivateEndpointConnection, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update the state of specified private endpoint connection associated with the redis cache. - * - * @summary Update the state of specified private endpoint connection associated with the redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCachePutPrivateEndpointConnection.json - */ -async function redisCachePutPrivateEndpointConnection(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "{subscriptionId}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cachetest01"; - const privateEndpointConnectionName = "pectest01"; - const properties: PrivateEndpointConnection = { - privateLinkServiceConnectionState: { - description: "Auto-Approved", - status: "Approved", - }, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.privateEndpointConnections.beginPutAndWait( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - properties, - ); - console.log(result); -} - -async function main(): Promise { - await redisCachePutPrivateEndpointConnection(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateLinkResourcesListByRedisCacheSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateLinkResourcesListByRedisCacheSample.ts deleted file mode 100644 index c1428246cb11..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/privateLinkResourcesListByRedisCacheSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets the private link resources that need to be created for a redis cache. - * - * @summary Gets the private link resources that need to be created for a redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListPrivateLinkResources.json - */ -async function storageAccountListPrivateLinkResources(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "{subscription-id}"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rgtest01"; - const cacheName = "cacheTest01"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.privateLinkResources.listByRedisCache( - resourceGroupName, - cacheName, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await storageAccountListPrivateLinkResources(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCheckNameAvailabilitySample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCheckNameAvailabilitySample.ts deleted file mode 100644 index e4b7d32f72bb..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCheckNameAvailabilitySample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - CheckNameAvailabilityParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Checks that the redis cache name is valid and is not already in use. - * - * @summary Checks that the redis cache name is valid and is not already in use. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCheckNameAvailability.json - */ -async function redisCacheCheckNameAvailability(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const parameters: CheckNameAvailabilityParameters = { - name: "cacheName", - type: "Microsoft.Cache/Redis", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.checkNameAvailability(parameters); - console.log(result); -} - -async function main(): Promise { - await redisCacheCheckNameAvailability(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCreateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCreateSample.ts deleted file mode 100644 index 584c3d00c8e1..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisCreateSample.ts +++ /dev/null @@ -1,226 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisCreateParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreate.json - */ -async function redisCacheCreate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "4", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateAutomaticZonalAllocationPolicy.json - */ -async function redisCacheCreateAutomaticZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "Automatic", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateDefaultVersion.json - */ -async function redisCacheCreateDefaultVersion(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateLatestVersion.json - */ -async function redisCacheCreateLatestVersion(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateNoZonesZonalAllocationPolicy.json - */ -async function redisCacheCreateNoZonesZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "NoZones", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -/** - * This sample demonstrates how to Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * - * @summary Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheCreateUserDefinedZonalAllocationPolicy.json - */ -async function redisCacheCreateUserDefinedZonalAllocationPolicy(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisCreateParameters = { - enableNonSslPort: true, - location: "East US", - minimumTlsVersion: "1.2", - redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, - redisVersion: "Latest", - replicasPerPrimary: 2, - shardCount: 2, - sku: { name: "Premium", capacity: 1, family: "P" }, - staticIP: "192.168.0.5", - subnetId: - "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", - zonalAllocationPolicy: "UserDefined", - zones: ["1"], - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginCreateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheCreate(); - await redisCacheCreateAutomaticZonalAllocationPolicy(); - await redisCacheCreateDefaultVersion(); - await redisCacheCreateLatestVersion(); - await redisCacheCreateNoZonesZonalAllocationPolicy(); - await redisCacheCreateUserDefinedZonalAllocationPolicy(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisDeleteSample.ts deleted file mode 100644 index bc91504d3386..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisDeleteSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes a Redis cache. - * - * @summary Deletes a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheDelete.json - */ -async function redisCacheDelete(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginDeleteAndWait(resourceGroupName, name); - console.log(result); -} - -async function main(): Promise { - await redisCacheDelete(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisExportDataSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisExportDataSample.ts deleted file mode 100644 index 2d40ab7c1067..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisExportDataSample.ts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - ExportRDBParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Export data from the redis cache to blobs in a container. - * - * @summary Export data from the redis cache to blobs in a container. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheExport.json - */ -async function redisCacheExport(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: ExportRDBParameters = { - format: "RDB", - container: - "https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters", - prefix: "datadump1", - storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginExportDataAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheExport(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisFlushCacheSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisFlushCacheSample.ts deleted file mode 100644 index aec2bbf24a5e..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisFlushCacheSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Deletes all of the keys in a cache. - * - * @summary Deletes all of the keys in a cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheFlush.json - */ -async function redisCacheFlush(): Promise { - const subscriptionId = - process.env["REDIS_SUBSCRIPTION_ID"] || "subcription-id"; - const resourceGroupName = - process.env["REDIS_RESOURCE_GROUP"] || "resource-group-name"; - const cacheName = "cache-name"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginFlushCacheAndWait( - resourceGroupName, - cacheName, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheFlush(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisForceRebootSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisForceRebootSample.ts deleted file mode 100644 index 0e6558dce87f..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisForceRebootSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisRebootParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * - * @summary Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheForceReboot.json - */ -async function redisCacheForceReboot(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisRebootParameters = { - ports: [13000, 15001], - rebootType: "AllNodes", - shardId: 0, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.forceReboot( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheForceReboot(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisGetSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisGetSample.ts deleted file mode 100644 index 48fb5587c487..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisGetSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets a Redis cache (resource description). - * - * @summary Gets a Redis cache (resource description). - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheGet.json - */ -async function redisCacheGet(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.get(resourceGroupName, name); - console.log(result); -} - -async function main(): Promise { - await redisCacheGet(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisImportDataSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisImportDataSample.ts deleted file mode 100644 index 98946ede0f76..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisImportDataSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - ImportRDBParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Import data into Redis cache. - * - * @summary Import data into Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheImport.json - */ -async function redisCacheImport(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: ImportRDBParameters = { - format: "RDB", - files: ["http://fileuris.contoso.com/pathtofile1"], - storageSubscriptionId: "storageSubId", - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginImportDataAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheImport(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListByResourceGroupSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListByResourceGroupSample.ts deleted file mode 100644 index 9eca3ebd71de..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListByResourceGroupSample.ts +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Lists all Redis caches in a resource group. - * - * @summary Lists all Redis caches in a resource group. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListByResourceGroup.json - */ -async function redisCacheListByResourceGroup(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListBySubscriptionSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListBySubscriptionSample.ts deleted file mode 100644 index 688db9d128ab..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListBySubscriptionSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets all Redis caches in the specified subscription. - * - * @summary Gets all Redis caches in the specified subscription. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheList.json - */ -async function redisCacheList(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheList(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListKeysSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListKeysSample.ts deleted file mode 100644 index 8c4a365be191..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListKeysSample.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListKeys.json - */ -async function redisCacheListKeys(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.listKeys(resourceGroupName, name); - console.log(result); -} - -async function main(): Promise { - await redisCacheListKeys(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListUpgradeNotificationsSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListUpgradeNotificationsSample.ts deleted file mode 100644 index 26490a33beb7..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisListUpgradeNotificationsSample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { RedisManagementClient } from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Gets any upgrade notifications for a Redis cache. - * - * @summary Gets any upgrade notifications for a Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheListUpgradeNotifications.json - */ -async function redisCacheListUpgradeNotifications(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const history = 5000; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.redis.listUpgradeNotifications( - resourceGroupName, - name, - history, - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main(): Promise { - await redisCacheListUpgradeNotifications(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisRegenerateKeySample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisRegenerateKeySample.ts deleted file mode 100644 index 6918091dd09b..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisRegenerateKeySample.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisRegenerateKeyParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * - * @summary Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheRegenerateKey.json - */ -async function redisCacheRegenerateKey(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisRegenerateKeyParameters = { keyType: "Primary" }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.regenerateKey( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheRegenerateKey(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisUpdateSample.ts deleted file mode 100644 index 58ef8c65940c..000000000000 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/src/redisUpdateSample.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { - RedisUpdateParameters, - RedisManagementClient, -} from "@azure/arm-rediscache"; -import { DefaultAzureCredential } from "@azure/identity"; -import "dotenv/config"; - -/** - * This sample demonstrates how to Update an existing Redis cache. - * - * @summary Update an existing Redis cache. - * x-ms-original-file: specification/redis/resource-manager/Microsoft.Cache/stable/2024-11-01/examples/RedisCacheUpdate.json - */ -async function redisCacheUpdate(): Promise { - const subscriptionId = process.env["REDIS_SUBSCRIPTION_ID"] || "subid"; - const resourceGroupName = process.env["REDIS_RESOURCE_GROUP"] || "rg1"; - const name = "cache1"; - const parameters: RedisUpdateParameters = { - enableNonSslPort: true, - replicasPerPrimary: 2, - }; - const credential = new DefaultAzureCredential(); - const client = new RedisManagementClient(credential, subscriptionId); - const result = await client.redis.beginUpdateAndWait( - resourceGroupName, - name, - parameters, - ); - console.log(result); -} - -async function main(): Promise { - await redisCacheUpdate(); -} - -main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/README.md b/sdk/redis/arm-rediscache/samples/v9/javascript/README.md new file mode 100644 index 000000000000..5cc1e8c8a189 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/README.md @@ -0,0 +1,130 @@ +# @azure/arm-rediscache client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for @azure/arm-rediscache in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessPolicyAssignmentCreateUpdateSample.js][accesspolicyassignmentcreateupdatesample] | adds the access policy assignment to the specified users x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentCreateUpdate.json | +| [accessPolicyAssignmentDeleteSample.js][accesspolicyassignmentdeletesample] | deletes the access policy assignment from a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentDelete.json | +| [accessPolicyAssignmentGetSample.js][accesspolicyassignmentgetsample] | gets the list of assignments for an access policy of a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentGet.json | +| [accessPolicyAssignmentListSample.js][accesspolicyassignmentlistsample] | gets the list of access policy assignments associated with this redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentList.json | +| [accessPolicyCreateUpdateSample.js][accesspolicycreateupdatesample] | adds an access policy to the redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyCreateUpdate.json | +| [accessPolicyDeleteSample.js][accesspolicydeletesample] | deletes the access policy from a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyDelete.json | +| [accessPolicyGetSample.js][accesspolicygetsample] | gets the detailed information about an access policy of a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyGet.json | +| [accessPolicyListSample.js][accesspolicylistsample] | gets the list of access policies associated with this redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyList.json | +| [asyncOperationStatusGetSample.js][asyncoperationstatusgetsample] | for checking the ongoing status of an operation x-ms-original-file: 2024-11-01/RedisCacheAsyncOperationStatus.json | +| [firewallRulesCreateOrUpdateSample.js][firewallrulescreateorupdatesample] | create or update a redis cache firewall rule x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleCreate.json | +| [firewallRulesDeleteSample.js][firewallrulesdeletesample] | deletes a single firewall rule in a specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleDelete.json | +| [firewallRulesGetSample.js][firewallrulesgetsample] | gets a single firewall rule in a specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleGet.json | +| [firewallRulesListSample.js][firewallruleslistsample] | gets all firewall rules in the specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRulesList.json | +| [linkedServerCreateSample.js][linkedservercreatesample] | adds a linked server to the Redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Create.json | +| [linkedServerDeleteSample.js][linkedserverdeletesample] | deletes the linked server from a redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Delete.json | +| [linkedServerGetSample.js][linkedservergetsample] | gets the detailed information about a linked server of a redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Get.json | +| [linkedServerListSample.js][linkedserverlistsample] | gets the list of linked servers associated with this redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_List.json | +| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-11-01/RedisCacheOperations.json | +| [patchSchedulesCreateOrUpdateSample.js][patchschedulescreateorupdatesample] | create or replace the patching schedule for Redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesCreateOrUpdate.json | +| [patchSchedulesDeleteSample.js][patchschedulesdeletesample] | deletes the patching schedule of a redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesDelete.json | +| [patchSchedulesGetSample.js][patchschedulesgetsample] | gets the patching schedule of a redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesGet.json | +| [patchSchedulesListByRedisResourceSample.js][patchscheduleslistbyredisresourcesample] | gets all patch schedules in the specified redis cache (there is only one). x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesList.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheDeletePrivateEndpointConnection.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheGetPrivateEndpointConnection.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | list all the private endpoint connections associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheListPrivateEndpointConnections.json | +| [privateEndpointConnectionsPutSample.js][privateendpointconnectionsputsample] | update the state of specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCachePutPrivateEndpointConnection.json | +| [privateLinkResourcesListByRedisCacheSample.js][privatelinkresourceslistbyrediscachesample] | gets the private link resources that need to be created for a redis cache. x-ms-original-file: 2024-11-01/RedisCacheListPrivateLinkResources.json | +| [redisCheckNameAvailabilitySample.js][redischecknameavailabilitysample] | checks that the redis cache name is valid and is not already in use. x-ms-original-file: 2024-11-01/RedisCacheCheckNameAvailability.json | +| [redisCreateSample.js][rediscreatesample] | create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. x-ms-original-file: 2024-11-01/RedisCacheCreate.json | +| [redisDeleteSample.js][redisdeletesample] | deletes a Redis cache. x-ms-original-file: 2024-11-01/RedisCacheDelete.json | +| [redisExportDataSample.js][redisexportdatasample] | export data from the redis cache to blobs in a container. x-ms-original-file: 2024-11-01/RedisCacheExport.json | +| [redisFlushCacheSample.js][redisflushcachesample] | deletes all of the keys in a cache. x-ms-original-file: 2024-11-01/RedisCacheFlush.json | +| [redisForceRebootSample.js][redisforcerebootsample] | reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. x-ms-original-file: 2024-11-01/RedisCacheForceReboot.json | +| [redisGetSample.js][redisgetsample] | gets a Redis cache (resource description). x-ms-original-file: 2024-11-01/RedisCacheGet.json | +| [redisImportDataSample.js][redisimportdatasample] | import data into Redis cache. x-ms-original-file: 2024-11-01/RedisCacheImport.json | +| [redisListByResourceGroupSample.js][redislistbyresourcegroupsample] | lists all Redis caches in a resource group. x-ms-original-file: 2024-11-01/RedisCacheListByResourceGroup.json | +| [redisListBySubscriptionSample.js][redislistbysubscriptionsample] | gets all Redis caches in the specified subscription. x-ms-original-file: 2024-11-01/RedisCacheList.json | +| [redisListKeysSample.js][redislistkeyssample] | retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: 2024-11-01/RedisCacheListKeys.json | +| [redisListUpgradeNotificationsSample.js][redislistupgradenotificationssample] | [Deprecated] Gets any upgrade notifications for a Redis cache. x-ms-original-file: 2024-11-01/RedisCacheListUpgradeNotifications.json | +| [redisRegenerateKeySample.js][redisregeneratekeysample] | regenerate Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: 2024-11-01/RedisCacheRegenerateKey.json | +| [redisUpdateSample.js][redisupdatesample] | update an existing Redis cache. x-ms-original-file: 2024-11-01/RedisCacheUpdate.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +3. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node accessPolicyAssignmentCreateUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node accessPolicyAssignmentCreateUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesspolicyassignmentcreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentCreateUpdateSample.js +[accesspolicyassignmentdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentDeleteSample.js +[accesspolicyassignmentgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentGetSample.js +[accesspolicyassignmentlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentListSample.js +[accesspolicycreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyCreateUpdateSample.js +[accesspolicydeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyDeleteSample.js +[accesspolicygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyGetSample.js +[accesspolicylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyListSample.js +[asyncoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/asyncOperationStatusGetSample.js +[firewallrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesCreateOrUpdateSample.js +[firewallrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesDeleteSample.js +[firewallrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesGetSample.js +[firewallruleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesListSample.js +[linkedservercreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerCreateSample.js +[linkedserverdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerDeleteSample.js +[linkedservergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerGetSample.js +[linkedserverlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerListSample.js +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/operationsListSample.js +[patchschedulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesCreateOrUpdateSample.js +[patchschedulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesDeleteSample.js +[patchschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesGetSample.js +[patchscheduleslistbyredisresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesListByRedisResourceSample.js +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsDeleteSample.js +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsGetSample.js +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsListSample.js +[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsPutSample.js +[privatelinkresourceslistbyrediscachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/privateLinkResourcesListByRedisCacheSample.js +[redischecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisCheckNameAvailabilitySample.js +[rediscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisCreateSample.js +[redisdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisDeleteSample.js +[redisexportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisExportDataSample.js +[redisflushcachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisFlushCacheSample.js +[redisforcerebootsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisForceRebootSample.js +[redisgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisGetSample.js +[redisimportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisImportDataSample.js +[redislistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisListByResourceGroupSample.js +[redislistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisListBySubscriptionSample.js +[redislistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisListKeysSample.js +[redislistupgradenotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisListUpgradeNotificationsSample.js +[redisregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisRegenerateKeySample.js +[redisupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/javascript/redisUpdateSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/README.md diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentCreateUpdateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentCreateUpdateSample.js new file mode 100644 index 000000000000..9239d930470a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentCreateUpdateSample.js @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to adds the access policy assignment to the specified users + * + * @summary adds the access policy assignment to the specified users + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentCreateUpdate.json + */ +async function redisCacheAccessPolicyAssignmentCreateUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicyAssignment.createUpdate( + "rg1", + "cache1", + "accessPolicyAssignmentName1", + { + properties: { + accessPolicyName: "accessPolicy1", + objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", + objectIdAlias: "TestAADAppRedis", + }, + }, + ); + console.log(result); +} + +async function main() { + await redisCacheAccessPolicyAssignmentCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentDeleteSample.js new file mode 100644 index 000000000000..67df38dfc4ed --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the access policy assignment from a redis cache + * + * @summary deletes the access policy assignment from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentDelete.json + */ +async function redisCacheAccessPolicyAssignmentDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.accessPolicyAssignment.delete("rg1", "cache1", "accessPolicyAssignmentName1"); +} + +async function main() { + await redisCacheAccessPolicyAssignmentDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentGetSample.js new file mode 100644 index 000000000000..21d9a0ad081e --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the list of assignments for an access policy of a redis cache + * + * @summary gets the list of assignments for an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentGet.json + */ +async function redisCacheAccessPolicyAssignmentGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicyAssignment.get( + "rg1", + "cache1", + "accessPolicyAssignmentName1", + ); + console.log(result); +} + +async function main() { + await redisCacheAccessPolicyAssignmentGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentListSample.js new file mode 100644 index 000000000000..21091bab5429 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyAssignmentListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the list of access policy assignments associated with this redis cache + * + * @summary gets the list of access policy assignments associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentList.json + */ +async function redisCacheAccessPolicyAssignmentList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.accessPolicyAssignment.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheAccessPolicyAssignmentList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyCreateUpdateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyCreateUpdateSample.js new file mode 100644 index 000000000000..ed29c3b719be --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyCreateUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to adds an access policy to the redis cache + * + * @summary adds an access policy to the redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyCreateUpdate.json + */ +async function redisCacheAccessPolicyCreateUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicy.createUpdate("rg1", "cache1", "accessPolicy1", { + properties: { permissions: "+get +hget" }, + }); + console.log(result); +} + +async function main() { + await redisCacheAccessPolicyCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyDeleteSample.js new file mode 100644 index 000000000000..a7c6a3ff874b --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the access policy from a redis cache + * + * @summary deletes the access policy from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyDelete.json + */ +async function redisCacheAccessPolicyDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.accessPolicy.delete("rg1", "cache1", "accessPolicy1"); +} + +async function main() { + await redisCacheAccessPolicyDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyGetSample.js new file mode 100644 index 000000000000..3def528e0c49 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the detailed information about an access policy of a redis cache + * + * @summary gets the detailed information about an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyGet.json + */ +async function redisCacheAccessPolicyGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicy.get("rg1", "cache1", "accessPolicy1"); + console.log(result); +} + +async function main() { + await redisCacheAccessPolicyGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyListSample.js new file mode 100644 index 000000000000..5dd96aebb3a5 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/accessPolicyListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the list of access policies associated with this redis cache + * + * @summary gets the list of access policies associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyList.json + */ +async function redisCacheAccessPolicyList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.accessPolicy.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheAccessPolicyList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/asyncOperationStatusGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/asyncOperationStatusGetSample.js new file mode 100644 index 000000000000..b7f9ed00de7b --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/asyncOperationStatusGetSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to for checking the ongoing status of an operation + * + * @summary for checking the ongoing status of an operation + * x-ms-original-file: 2024-11-01/RedisCacheAsyncOperationStatus.json + */ +async function redisCacheAsyncOperationStatus() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.asyncOperationStatus.get( + "East US", + "c7ba2bf5-5939-4d79-b037-2964ccf097da", + ); + console.log(result); +} + +async function main() { + await redisCacheAsyncOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesCreateOrUpdateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesCreateOrUpdateSample.js new file mode 100644 index 000000000000..ebbc96982c86 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesCreateOrUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or update a redis cache firewall rule + * + * @summary create or update a redis cache firewall rule + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleCreate.json + */ +async function redisCacheFirewallRuleCreate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.firewallRules.createOrUpdate("rg1", "cache1", "rule1", { + properties: { endIP: "192.168.1.4", startIP: "192.168.1.1" }, + }); + console.log(result); +} + +async function main() { + await redisCacheFirewallRuleCreate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesDeleteSample.js new file mode 100644 index 000000000000..600730e4fa34 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a single firewall rule in a specified redis cache. + * + * @summary deletes a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleDelete.json + */ +async function redisCacheFirewallRuleDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.firewallRules.delete("rg1", "cache1", "rule1"); +} + +async function main() { + await redisCacheFirewallRuleDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesGetSample.js new file mode 100644 index 000000000000..f25f058bac9c --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a single firewall rule in a specified redis cache. + * + * @summary gets a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleGet.json + */ +async function redisCacheFirewallRuleGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.firewallRules.get("rg1", "cache1", "rule1"); + console.log(result); +} + +async function main() { + await redisCacheFirewallRuleGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesListSample.js new file mode 100644 index 000000000000..c112aa7c2cd0 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/firewallRulesListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all firewall rules in the specified redis cache. + * + * @summary gets all firewall rules in the specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRulesList.json + */ +async function redisCacheFirewallRulesList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.firewallRules.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheFirewallRulesList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerCreateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerCreateSample.js new file mode 100644 index 000000000000..72968df5c3ea --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerCreateSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to adds a linked server to the Redis cache (requires Premium SKU). + * + * @summary adds a linked server to the Redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Create.json + */ +async function linkedServerCreate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.linkedServer.create("rg1", "cache1", "cache2", { + properties: { + linkedRedisCacheId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", + linkedRedisCacheLocation: "West US", + serverRole: "Secondary", + }, + }); + console.log(result); +} + +async function main() { + await linkedServerCreate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerDeleteSample.js new file mode 100644 index 000000000000..99a3b376b53c --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the linked server from a redis cache (requires Premium SKU). + * + * @summary deletes the linked server from a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Delete.json + */ +async function linkedServerDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.linkedServer.delete("rg1", "cache1", "cache2"); +} + +async function main() { + await linkedServerDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerGetSample.js new file mode 100644 index 000000000000..4f09e5dd19b7 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @summary gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Get.json + */ +async function linkedServerGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.linkedServer.get("rg1", "cache1", "cache2"); + console.log(result); +} + +async function main() { + await linkedServerGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerListSample.js new file mode 100644 index 000000000000..5caa2181bec9 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/linkedServerListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @summary gets the list of linked servers associated with this redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_List.json + */ +async function linkedServerList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.linkedServer.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await linkedServerList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/operationsListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/operationsListSample.js new file mode 100644 index 000000000000..8d0751dba456 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/operationsListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2024-11-01/RedisCacheOperations.json + */ +async function redisCacheOperations() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheOperations(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/package.json b/sdk/redis/arm-rediscache/samples/v9/javascript/package.json similarity index 79% rename from sdk/redis/arm-rediscache/samples/v8/javascript/package.json rename to sdk/redis/arm-rediscache/samples/v9/javascript/package.json index 6168f58b1817..85392332b499 100644 --- a/sdk/redis/arm-rediscache/samples/v8/javascript/package.json +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-rediscache-js", "private": true, "version": "1.0.0", - "description": " client library samples for JavaScript", + "description": "@azure/arm-rediscache client library samples for JavaScript", "engines": { "node": ">=20.0.0" }, @@ -14,6 +14,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -27,6 +28,9 @@ "dependencies": { "@azure/arm-rediscache": "latest", "dotenv": "latest", - "@azure/identity": "^4.6.0" + "@azure/identity": "^4.11.1" + }, + "devDependencies": { + "cross-env": "latest" } } diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesCreateOrUpdateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesCreateOrUpdateSample.js new file mode 100644 index 000000000000..087b7f2c225b --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesCreateOrUpdateSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or replace the patching schedule for Redis cache. + * + * @summary create or replace the patching schedule for Redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesCreateOrUpdate.json + */ +async function redisCachePatchSchedulesCreateOrUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.patchSchedules.createOrUpdate("rg1", "cache1", "default", { + properties: { + scheduleEntries: [ + { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, + { dayOfWeek: "Tuesday", startHourUtc: 12 }, + ], + }, + }); + console.log(result); +} + +async function main() { + await redisCachePatchSchedulesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesDeleteSample.js new file mode 100644 index 000000000000..70dd4caee7ed --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the patching schedule of a redis cache. + * + * @summary deletes the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesDelete.json + */ +async function redisCachePatchSchedulesDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.patchSchedules.delete("rg1", "cache1", "default"); +} + +async function main() { + await redisCachePatchSchedulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesGetSample.js new file mode 100644 index 000000000000..f62753365c1e --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the patching schedule of a redis cache. + * + * @summary gets the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesGet.json + */ +async function redisCachePatchSchedulesGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.patchSchedules.get("rg1", "cache1", "default"); + console.log(result); +} + +async function main() { + await redisCachePatchSchedulesGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesListByRedisResourceSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesListByRedisResourceSample.js new file mode 100644 index 000000000000..7be8a68b334a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/patchSchedulesListByRedisResourceSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all patch schedules in the specified redis cache (there is only one). + * + * @summary gets all patch schedules in the specified redis cache (there is only one). + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesList.json + */ +async function redisCachePatchSchedulesList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.patchSchedules.listByRedisResource("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCachePatchSchedulesList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsDeleteSample.js new file mode 100644 index 000000000000..fae9e0d5d3a8 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the redis cache. + * + * @summary deletes the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDeletePrivateEndpointConnection.json + */ +async function redisCacheDeletePrivateEndpointConnection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.privateEndpointConnections.delete("rgtest01", "cachetest01", "pectest01"); +} + +async function main() { + await redisCacheDeletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsGetSample.js new file mode 100644 index 000000000000..e0728c37be6a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsGetSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the redis cache. + * + * @summary gets the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheGetPrivateEndpointConnection.json + */ +async function redisCacheGetPrivateEndpointConnection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "rgtest01", + "cachetest01", + "pectest01", + ); + console.log(result); +} + +async function main() { + await redisCacheGetPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsListSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsListSample.js new file mode 100644 index 000000000000..faa38e3616ae --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsListSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to list all the private endpoint connections associated with the redis cache. + * + * @summary list all the private endpoint connections associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateEndpointConnections.json + */ +async function redisCacheListPrivateEndpointConnection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list("rgtest01", "cachetest01")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheListPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsPutSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsPutSample.js new file mode 100644 index 000000000000..3b803e58262f --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/privateEndpointConnectionsPutSample.js @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the redis cache. + * + * @summary update the state of specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePutPrivateEndpointConnection.json + */ +async function redisCachePutPrivateEndpointConnection() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.put( + "rgtest01", + "cachetest01", + "pectest01", + { + properties: { + privateLinkServiceConnectionState: { + description: "Auto-Approved", + status: "Approved", + }, + }, + }, + ); + console.log(result); +} + +async function main() { + await redisCachePutPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/privateLinkResourcesListByRedisCacheSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/privateLinkResourcesListByRedisCacheSample.js new file mode 100644 index 000000000000..170dd26d68be --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/privateLinkResourcesListByRedisCacheSample.js @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a redis cache. + * + * @summary gets the private link resources that need to be created for a redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateLinkResources.json + */ +async function storageAccountListPrivateLinkResources() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateLinkResources.listByRedisCache( + "rgtest01", + "cacheTest01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await storageAccountListPrivateLinkResources(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisCheckNameAvailabilitySample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisCheckNameAvailabilitySample.js new file mode 100644 index 000000000000..6c95d530d796 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisCheckNameAvailabilitySample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to checks that the redis cache name is valid and is not already in use. + * + * @summary checks that the redis cache name is valid and is not already in use. + * x-ms-original-file: 2024-11-01/RedisCacheCheckNameAvailability.json + */ +async function redisCacheCheckNameAvailability() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.checkNameAvailability({ + name: "cacheName", + type: "Microsoft.Cache/Redis", + }); +} + +async function main() { + await redisCacheCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisCreateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisCreateSample.js new file mode 100644 index 000000000000..31f9c60ff8de --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisCreateSample.js @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreate.json + */ +async function redisCacheCreate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "4", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateAutomaticZonalAllocationPolicy.json + */ +async function redisCacheCreateAutomaticZonalAllocationPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "Automatic", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateDefaultVersion.json + */ +async function redisCacheCreateDefaultVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateLatestVersion.json + */ +async function redisCacheCreateLatestVersion() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateNoZonesZonalAllocationPolicy.json + */ +async function redisCacheCreateNoZonesZonalAllocationPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "NoZones", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateUserDefinedZonalAllocationPolicy.json + */ +async function redisCacheCreateUserDefinedZonalAllocationPolicy() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "UserDefined", + }, + zones: ["1"], + }); + console.log(result); +} + +async function main() { + await redisCacheCreate(); + await redisCacheCreateAutomaticZonalAllocationPolicy(); + await redisCacheCreateDefaultVersion(); + await redisCacheCreateLatestVersion(); + await redisCacheCreateNoZonesZonalAllocationPolicy(); + await redisCacheCreateUserDefinedZonalAllocationPolicy(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisDeleteSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisDeleteSample.js new file mode 100644 index 000000000000..34b505f51b8a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisDeleteSample.js @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes a Redis cache. + * + * @summary deletes a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDelete.json + */ +async function redisCacheDelete() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.delete("rg1", "cache1"); +} + +async function main() { + await redisCacheDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisExportDataSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisExportDataSample.js new file mode 100644 index 000000000000..370a7f3ebb48 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisExportDataSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to export data from the redis cache to blobs in a container. + * + * @summary export data from the redis cache to blobs in a container. + * x-ms-original-file: 2024-11-01/RedisCacheExport.json + */ +async function redisCacheExport() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.exportData("rg1", "cache1", { + format: "RDB", + container: "https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters", + prefix: "datadump1", + storageSubscriptionId: "storageSubId", + }); +} + +async function main() { + await redisCacheExport(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisFlushCacheSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisFlushCacheSample.js new file mode 100644 index 000000000000..e70e8adfc0bd --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisFlushCacheSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to deletes all of the keys in a cache. + * + * @summary deletes all of the keys in a cache. + * x-ms-original-file: 2024-11-01/RedisCacheFlush.json + */ +async function redisCacheFlush() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.flushCache("resource-group-name", "cache-name"); + console.log(result); +} + +async function main() { + await redisCacheFlush(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisForceRebootSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisForceRebootSample.js new file mode 100644 index 000000000000..365b486a1f3a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisForceRebootSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * + * @summary reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * x-ms-original-file: 2024-11-01/RedisCacheForceReboot.json + */ +async function redisCacheForceReboot() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.forceReboot("rg1", "cache1", { + ports: [13000, 15001], + rebootType: "AllNodes", + shardId: 0, + }); + console.log(result); +} + +async function main() { + await redisCacheForceReboot(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisGetSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisGetSample.js new file mode 100644 index 000000000000..7a76f204271c --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisGetSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets a Redis cache (resource description). + * + * @summary gets a Redis cache (resource description). + * x-ms-original-file: 2024-11-01/RedisCacheGet.json + */ +async function redisCacheGet() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.get("rg1", "cache1"); + console.log(result); +} + +async function main() { + await redisCacheGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisImportDataSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisImportDataSample.js new file mode 100644 index 000000000000..98bfbbe54158 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisImportDataSample.js @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to import data into Redis cache. + * + * @summary import data into Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheImport.json + */ +async function redisCacheImport() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.importData("rg1", "cache1", { + format: "RDB", + files: ["http://fileuris.contoso.com/pathtofile1"], + storageSubscriptionId: "storageSubId", + }); +} + +async function main() { + await redisCacheImport(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisListByResourceGroupSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListByResourceGroupSample.js new file mode 100644 index 000000000000..86318d3497c3 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListByResourceGroupSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to lists all Redis caches in a resource group. + * + * @summary lists all Redis caches in a resource group. + * x-ms-original-file: 2024-11-01/RedisCacheListByResourceGroup.json + */ +async function redisCacheListByResourceGroup() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listByResourceGroup("rg1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisListBySubscriptionSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListBySubscriptionSample.js new file mode 100644 index 000000000000..9f159602b22e --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListBySubscriptionSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to gets all Redis caches in the specified subscription. + * + * @summary gets all Redis caches in the specified subscription. + * x-ms-original-file: 2024-11-01/RedisCacheList.json + */ +async function redisCacheList() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisListKeysSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListKeysSample.js new file mode 100644 index 000000000000..77e7c38d0d61 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListKeysSample.js @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheListKeys.json + */ +async function redisCacheListKeys() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.listKeys("rg1", "cache1"); + console.log(result); +} + +async function main() { + await redisCacheListKeys(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisListUpgradeNotificationsSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListUpgradeNotificationsSample.js new file mode 100644 index 000000000000..4df0ab70f89b --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisListUpgradeNotificationsSample.js @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to [Deprecated] Gets any upgrade notifications for a Redis cache. + * + * @summary [Deprecated] Gets any upgrade notifications for a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListUpgradeNotifications.json + */ +async function redisCacheListUpgradeNotifications() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listUpgradeNotifications("rg1", "cache1", 5000)) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main() { + await redisCacheListUpgradeNotifications(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisRegenerateKeySample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisRegenerateKeySample.js new file mode 100644 index 000000000000..c13a30281f4c --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisRegenerateKeySample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheRegenerateKey.json + */ +async function redisCacheRegenerateKey() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.regenerateKey("rg1", "cache1", { + keyType: "Primary", + }); + console.log(result); +} + +async function main() { + await redisCacheRegenerateKey(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/javascript/redisUpdateSample.js b/sdk/redis/arm-rediscache/samples/v9/javascript/redisUpdateSample.js new file mode 100644 index 000000000000..b44d92dff559 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/javascript/redisUpdateSample.js @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +const { RedisManagementClient } = require("@azure/arm-rediscache"); +const { DefaultAzureCredential } = require("@azure/identity"); + +/** + * This sample demonstrates how to update an existing Redis cache. + * + * @summary update an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheUpdate.json + */ +async function redisCacheUpdate() { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.update("rg1", "cache1", { + properties: { enableNonSslPort: true, replicasPerPrimary: 2 }, + }); + console.log(result); +} + +async function main() { + await redisCacheUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/javascript/sample.env b/sdk/redis/arm-rediscache/samples/v9/javascript/sample.env similarity index 100% rename from sdk/redis/arm-rediscache/samples/v8/javascript/sample.env rename to sdk/redis/arm-rediscache/samples/v9/javascript/sample.env diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/README.md b/sdk/redis/arm-rediscache/samples/v9/typescript/README.md new file mode 100644 index 000000000000..697bdc0bee3f --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/README.md @@ -0,0 +1,143 @@ +# @azure/arm-rediscache client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for @azure/arm-rediscache in some common scenarios. + +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accessPolicyAssignmentCreateUpdateSample.ts][accesspolicyassignmentcreateupdatesample] | adds the access policy assignment to the specified users x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentCreateUpdate.json | +| [accessPolicyAssignmentDeleteSample.ts][accesspolicyassignmentdeletesample] | deletes the access policy assignment from a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentDelete.json | +| [accessPolicyAssignmentGetSample.ts][accesspolicyassignmentgetsample] | gets the list of assignments for an access policy of a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentGet.json | +| [accessPolicyAssignmentListSample.ts][accesspolicyassignmentlistsample] | gets the list of access policy assignments associated with this redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentList.json | +| [accessPolicyCreateUpdateSample.ts][accesspolicycreateupdatesample] | adds an access policy to the redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyCreateUpdate.json | +| [accessPolicyDeleteSample.ts][accesspolicydeletesample] | deletes the access policy from a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyDelete.json | +| [accessPolicyGetSample.ts][accesspolicygetsample] | gets the detailed information about an access policy of a redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyGet.json | +| [accessPolicyListSample.ts][accesspolicylistsample] | gets the list of access policies associated with this redis cache x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyList.json | +| [asyncOperationStatusGetSample.ts][asyncoperationstatusgetsample] | for checking the ongoing status of an operation x-ms-original-file: 2024-11-01/RedisCacheAsyncOperationStatus.json | +| [firewallRulesCreateOrUpdateSample.ts][firewallrulescreateorupdatesample] | create or update a redis cache firewall rule x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleCreate.json | +| [firewallRulesDeleteSample.ts][firewallrulesdeletesample] | deletes a single firewall rule in a specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleDelete.json | +| [firewallRulesGetSample.ts][firewallrulesgetsample] | gets a single firewall rule in a specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleGet.json | +| [firewallRulesListSample.ts][firewallruleslistsample] | gets all firewall rules in the specified redis cache. x-ms-original-file: 2024-11-01/RedisCacheFirewallRulesList.json | +| [linkedServerCreateSample.ts][linkedservercreatesample] | adds a linked server to the Redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Create.json | +| [linkedServerDeleteSample.ts][linkedserverdeletesample] | deletes the linked server from a redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Delete.json | +| [linkedServerGetSample.ts][linkedservergetsample] | gets the detailed information about a linked server of a redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Get.json | +| [linkedServerListSample.ts][linkedserverlistsample] | gets the list of linked servers associated with this redis cache (requires Premium SKU). x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_List.json | +| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-11-01/RedisCacheOperations.json | +| [patchSchedulesCreateOrUpdateSample.ts][patchschedulescreateorupdatesample] | create or replace the patching schedule for Redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesCreateOrUpdate.json | +| [patchSchedulesDeleteSample.ts][patchschedulesdeletesample] | deletes the patching schedule of a redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesDelete.json | +| [patchSchedulesGetSample.ts][patchschedulesgetsample] | gets the patching schedule of a redis cache. x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesGet.json | +| [patchSchedulesListByRedisResourceSample.ts][patchscheduleslistbyredisresourcesample] | gets all patch schedules in the specified redis cache (there is only one). x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesList.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | deletes the specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheDeletePrivateEndpointConnection.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | gets the specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheGetPrivateEndpointConnection.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | list all the private endpoint connections associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCacheListPrivateEndpointConnections.json | +| [privateEndpointConnectionsPutSample.ts][privateendpointconnectionsputsample] | update the state of specified private endpoint connection associated with the redis cache. x-ms-original-file: 2024-11-01/RedisCachePutPrivateEndpointConnection.json | +| [privateLinkResourcesListByRedisCacheSample.ts][privatelinkresourceslistbyrediscachesample] | gets the private link resources that need to be created for a redis cache. x-ms-original-file: 2024-11-01/RedisCacheListPrivateLinkResources.json | +| [redisCheckNameAvailabilitySample.ts][redischecknameavailabilitysample] | checks that the redis cache name is valid and is not already in use. x-ms-original-file: 2024-11-01/RedisCacheCheckNameAvailability.json | +| [redisCreateSample.ts][rediscreatesample] | create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. x-ms-original-file: 2024-11-01/RedisCacheCreate.json | +| [redisDeleteSample.ts][redisdeletesample] | deletes a Redis cache. x-ms-original-file: 2024-11-01/RedisCacheDelete.json | +| [redisExportDataSample.ts][redisexportdatasample] | export data from the redis cache to blobs in a container. x-ms-original-file: 2024-11-01/RedisCacheExport.json | +| [redisFlushCacheSample.ts][redisflushcachesample] | deletes all of the keys in a cache. x-ms-original-file: 2024-11-01/RedisCacheFlush.json | +| [redisForceRebootSample.ts][redisforcerebootsample] | reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. x-ms-original-file: 2024-11-01/RedisCacheForceReboot.json | +| [redisGetSample.ts][redisgetsample] | gets a Redis cache (resource description). x-ms-original-file: 2024-11-01/RedisCacheGet.json | +| [redisImportDataSample.ts][redisimportdatasample] | import data into Redis cache. x-ms-original-file: 2024-11-01/RedisCacheImport.json | +| [redisListByResourceGroupSample.ts][redislistbyresourcegroupsample] | lists all Redis caches in a resource group. x-ms-original-file: 2024-11-01/RedisCacheListByResourceGroup.json | +| [redisListBySubscriptionSample.ts][redislistbysubscriptionsample] | gets all Redis caches in the specified subscription. x-ms-original-file: 2024-11-01/RedisCacheList.json | +| [redisListKeysSample.ts][redislistkeyssample] | retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: 2024-11-01/RedisCacheListKeys.json | +| [redisListUpgradeNotificationsSample.ts][redislistupgradenotificationssample] | [Deprecated] Gets any upgrade notifications for a Redis cache. x-ms-original-file: 2024-11-01/RedisCacheListUpgradeNotifications.json | +| [redisRegenerateKeySample.ts][redisregeneratekeysample] | regenerate Redis cache's access keys. This operation requires write permission to the cache resource. x-ms-original-file: 2024-11-01/RedisCacheRegenerateKey.json | +| [redisUpdateSample.ts][redisupdatesample] | update an existing Redis cache. x-ms-original-file: 2024-11-01/RedisCacheUpdate.json | + +## Prerequisites + +The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). + +Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the [TypeScript documentation][typescript]. Install the TypeScript compiler using: + +```bash +npm install -g typescript +``` + +You need [an Azure subscription][freesub] to run these sample programs. + +Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function. + +Adapting the samples to run in the browser may require some additional consideration. For details, please see the [package README][package]. + +## Setup + +To run the samples using the published version of the package: + +1. Install the dependencies using `npm`: + +```bash +npm install +``` + +2. Compile the samples: + +```bash +npm run build +``` + +3. Edit the file `sample.env`, adding the correct credentials to access the Azure service and run the samples. Then rename the file from `sample.env` to just `.env`. The sample programs will read this file automatically. + +4. Run whichever samples you like (note that some samples may require additional setup, see the table above): + +```bash +node dist/accessPolicyAssignmentCreateUpdateSample.js +``` + +Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): + +```bash +node dist/accessPolicyAssignmentCreateUpdateSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[accesspolicyassignmentcreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts +[accesspolicyassignmentdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentDeleteSample.ts +[accesspolicyassignmentgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentGetSample.ts +[accesspolicyassignmentlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentListSample.ts +[accesspolicycreateupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyCreateUpdateSample.ts +[accesspolicydeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyDeleteSample.ts +[accesspolicygetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyGetSample.ts +[accesspolicylistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyListSample.ts +[asyncoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/asyncOperationStatusGetSample.ts +[firewallrulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesCreateOrUpdateSample.ts +[firewallrulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesDeleteSample.ts +[firewallrulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesGetSample.ts +[firewallruleslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesListSample.ts +[linkedservercreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerCreateSample.ts +[linkedserverdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerDeleteSample.ts +[linkedservergetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerGetSample.ts +[linkedserverlistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerListSample.ts +[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/operationsListSample.ts +[patchschedulescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesCreateOrUpdateSample.ts +[patchschedulesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesDeleteSample.ts +[patchschedulesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesGetSample.ts +[patchscheduleslistbyredisresourcesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesListByRedisResourceSample.ts +[privateendpointconnectionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsDeleteSample.ts +[privateendpointconnectionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsGetSample.ts +[privateendpointconnectionslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsListSample.ts +[privateendpointconnectionsputsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsPutSample.ts +[privatelinkresourceslistbyrediscachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateLinkResourcesListByRedisCacheSample.ts +[redischecknameavailabilitysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCheckNameAvailabilitySample.ts +[rediscreatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCreateSample.ts +[redisdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisDeleteSample.ts +[redisexportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisExportDataSample.ts +[redisflushcachesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisFlushCacheSample.ts +[redisforcerebootsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisForceRebootSample.ts +[redisgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisGetSample.ts +[redisimportdatasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisImportDataSample.ts +[redislistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListByResourceGroupSample.ts +[redislistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListBySubscriptionSample.ts +[redislistkeyssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListKeysSample.ts +[redislistupgradenotificationssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListUpgradeNotificationsSample.ts +[redisregeneratekeysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisRegenerateKeySample.ts +[redisupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisUpdateSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-rediscache?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/redis/arm-rediscache/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/package.json b/sdk/redis/arm-rediscache/samples/v9/typescript/package.json similarity index 80% rename from sdk/redis/arm-rediscache/samples/v8/typescript/package.json rename to sdk/redis/arm-rediscache/samples/v9/typescript/package.json index 6543f2362ca1..b0624f811b74 100644 --- a/sdk/redis/arm-rediscache/samples/v8/typescript/package.json +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/package.json @@ -2,7 +2,7 @@ "name": "@azure-samples/arm-rediscache-ts", "private": true, "version": "1.0.0", - "description": " client library samples for TypeScript", + "description": "@azure/arm-rediscache client library samples for TypeScript", "engines": { "node": ">=20.0.0" }, @@ -18,6 +18,7 @@ "keywords": [ "node", "azure", + "cloud", "typescript", "browser", "isomorphic" @@ -31,11 +32,12 @@ "dependencies": { "@azure/arm-rediscache": "latest", "dotenv": "latest", - "@azure/identity": "^4.6.0" + "@azure/identity": "^4.11.1" }, "devDependencies": { "@types/node": "^20.0.0", - "typescript": "~5.8.2", - "rimraf": "latest" + "cross-env": "latest", + "rimraf": "latest", + "typescript": "~5.9.3" } } diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/sample.env b/sdk/redis/arm-rediscache/samples/v9/typescript/sample.env similarity index 100% rename from sdk/redis/arm-rediscache/samples/v8/typescript/sample.env rename to sdk/redis/arm-rediscache/samples/v9/typescript/sample.env diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts new file mode 100644 index 000000000000..6f0641fb8391 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentCreateUpdateSample.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to adds the access policy assignment to the specified users + * + * @summary adds the access policy assignment to the specified users + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentCreateUpdate.json + */ +async function redisCacheAccessPolicyAssignmentCreateUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicyAssignment.createUpdate( + "rg1", + "cache1", + "accessPolicyAssignmentName1", + { + properties: { + accessPolicyName: "accessPolicy1", + objectId: "6497c918-11ad-41e7-1b0f-7c518a87d0b0", + objectIdAlias: "TestAADAppRedis", + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await redisCacheAccessPolicyAssignmentCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentDeleteSample.ts new file mode 100644 index 000000000000..39544fdcd139 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the access policy assignment from a redis cache + * + * @summary deletes the access policy assignment from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentDelete.json + */ +async function redisCacheAccessPolicyAssignmentDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.accessPolicyAssignment.delete("rg1", "cache1", "accessPolicyAssignmentName1"); +} + +async function main(): Promise { + await redisCacheAccessPolicyAssignmentDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentGetSample.ts new file mode 100644 index 000000000000..8b9153ecde96 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the list of assignments for an access policy of a redis cache + * + * @summary gets the list of assignments for an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentGet.json + */ +async function redisCacheAccessPolicyAssignmentGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicyAssignment.get( + "rg1", + "cache1", + "accessPolicyAssignmentName1", + ); + console.log(result); +} + +async function main(): Promise { + await redisCacheAccessPolicyAssignmentGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentListSample.ts new file mode 100644 index 000000000000..6aab702ccd3e --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyAssignmentListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the list of access policy assignments associated with this redis cache + * + * @summary gets the list of access policy assignments associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyAssignmentList.json + */ +async function redisCacheAccessPolicyAssignmentList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.accessPolicyAssignment.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheAccessPolicyAssignmentList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyCreateUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyCreateUpdateSample.ts new file mode 100644 index 000000000000..11ea12876c6a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyCreateUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to adds an access policy to the redis cache + * + * @summary adds an access policy to the redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyCreateUpdate.json + */ +async function redisCacheAccessPolicyCreateUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicy.createUpdate("rg1", "cache1", "accessPolicy1", { + properties: { permissions: "+get +hget" }, + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheAccessPolicyCreateUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyDeleteSample.ts new file mode 100644 index 000000000000..8c1a17765a02 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the access policy from a redis cache + * + * @summary deletes the access policy from a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyDelete.json + */ +async function redisCacheAccessPolicyDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.accessPolicy.delete("rg1", "cache1", "accessPolicy1"); +} + +async function main(): Promise { + await redisCacheAccessPolicyDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyGetSample.ts new file mode 100644 index 000000000000..2a0dc14f4510 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the detailed information about an access policy of a redis cache + * + * @summary gets the detailed information about an access policy of a redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyGet.json + */ +async function redisCacheAccessPolicyGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.accessPolicy.get("rg1", "cache1", "accessPolicy1"); + console.log(result); +} + +async function main(): Promise { + await redisCacheAccessPolicyGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyListSample.ts new file mode 100644 index 000000000000..4e1eabee9a81 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/accessPolicyListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the list of access policies associated with this redis cache + * + * @summary gets the list of access policies associated with this redis cache + * x-ms-original-file: 2024-11-01/RedisCacheAccessPolicyList.json + */ +async function redisCacheAccessPolicyList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.accessPolicy.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheAccessPolicyList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/asyncOperationStatusGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/asyncOperationStatusGetSample.ts new file mode 100644 index 000000000000..cd1a7dd08e84 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/asyncOperationStatusGetSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to for checking the ongoing status of an operation + * + * @summary for checking the ongoing status of an operation + * x-ms-original-file: 2024-11-01/RedisCacheAsyncOperationStatus.json + */ +async function redisCacheAsyncOperationStatus(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.asyncOperationStatus.get( + "East US", + "c7ba2bf5-5939-4d79-b037-2964ccf097da", + ); + console.log(result); +} + +async function main(): Promise { + await redisCacheAsyncOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..fa11b71eec98 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesCreateOrUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or update a redis cache firewall rule + * + * @summary create or update a redis cache firewall rule + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleCreate.json + */ +async function redisCacheFirewallRuleCreate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.firewallRules.createOrUpdate("rg1", "cache1", "rule1", { + properties: { endIP: "192.168.1.4", startIP: "192.168.1.1" }, + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheFirewallRuleCreate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesDeleteSample.ts new file mode 100644 index 000000000000..15143cbe7171 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a single firewall rule in a specified redis cache. + * + * @summary deletes a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleDelete.json + */ +async function redisCacheFirewallRuleDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.firewallRules.delete("rg1", "cache1", "rule1"); +} + +async function main(): Promise { + await redisCacheFirewallRuleDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesGetSample.ts new file mode 100644 index 000000000000..da07cae38355 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a single firewall rule in a specified redis cache. + * + * @summary gets a single firewall rule in a specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRuleGet.json + */ +async function redisCacheFirewallRuleGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.firewallRules.get("rg1", "cache1", "rule1"); + console.log(result); +} + +async function main(): Promise { + await redisCacheFirewallRuleGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesListSample.ts new file mode 100644 index 000000000000..4e98cb812908 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/firewallRulesListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all firewall rules in the specified redis cache. + * + * @summary gets all firewall rules in the specified redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheFirewallRulesList.json + */ +async function redisCacheFirewallRulesList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.firewallRules.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheFirewallRulesList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerCreateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerCreateSample.ts new file mode 100644 index 000000000000..7fe36bf18e32 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerCreateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to adds a linked server to the Redis cache (requires Premium SKU). + * + * @summary adds a linked server to the Redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Create.json + */ +async function linkedServerCreate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.linkedServer.create("rg1", "cache1", "cache2", { + properties: { + linkedRedisCacheId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/Redis/cache2", + linkedRedisCacheLocation: "West US", + serverRole: "Secondary", + }, + }); + console.log(result); +} + +async function main(): Promise { + await linkedServerCreate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerDeleteSample.ts new file mode 100644 index 000000000000..5ea0a94285ba --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the linked server from a redis cache (requires Premium SKU). + * + * @summary deletes the linked server from a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Delete.json + */ +async function linkedServerDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.linkedServer.delete("rg1", "cache1", "cache2"); +} + +async function main(): Promise { + await linkedServerDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerGetSample.ts new file mode 100644 index 000000000000..24638a3aedbc --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * + * @summary gets the detailed information about a linked server of a redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_Get.json + */ +async function linkedServerGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.linkedServer.get("rg1", "cache1", "cache2"); + console.log(result); +} + +async function main(): Promise { + await linkedServerGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerListSample.ts new file mode 100644 index 000000000000..2c50323f5a50 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/linkedServerListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the list of linked servers associated with this redis cache (requires Premium SKU). + * + * @summary gets the list of linked servers associated with this redis cache (requires Premium SKU). + * x-ms-original-file: 2024-11-01/RedisCacheLinkedServer_List.json + */ +async function linkedServerList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.linkedServer.list("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await linkedServerList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/operationsListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/operationsListSample.ts new file mode 100644 index 000000000000..b505dde74a5e --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/operationsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list the operations for the provider + * + * @summary list the operations for the provider + * x-ms-original-file: 2024-11-01/RedisCacheOperations.json + */ +async function redisCacheOperations(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-00000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.operations.list()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheOperations(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesCreateOrUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesCreateOrUpdateSample.ts new file mode 100644 index 000000000000..319e69dd9676 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesCreateOrUpdateSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or replace the patching schedule for Redis cache. + * + * @summary create or replace the patching schedule for Redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesCreateOrUpdate.json + */ +async function redisCachePatchSchedulesCreateOrUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.patchSchedules.createOrUpdate("rg1", "cache1", "default", { + properties: { + scheduleEntries: [ + { dayOfWeek: "Monday", maintenanceWindow: "PT5H", startHourUtc: 12 }, + { dayOfWeek: "Tuesday", startHourUtc: 12 }, + ], + }, + }); + console.log(result); +} + +async function main(): Promise { + await redisCachePatchSchedulesCreateOrUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesDeleteSample.ts new file mode 100644 index 000000000000..f493a683ad23 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the patching schedule of a redis cache. + * + * @summary deletes the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesDelete.json + */ +async function redisCachePatchSchedulesDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.patchSchedules.delete("rg1", "cache1", "default"); +} + +async function main(): Promise { + await redisCachePatchSchedulesDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesGetSample.ts new file mode 100644 index 000000000000..888936e7e50d --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the patching schedule of a redis cache. + * + * @summary gets the patching schedule of a redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesGet.json + */ +async function redisCachePatchSchedulesGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.patchSchedules.get("rg1", "cache1", "default"); + console.log(result); +} + +async function main(): Promise { + await redisCachePatchSchedulesGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesListByRedisResourceSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesListByRedisResourceSample.ts new file mode 100644 index 000000000000..a0b360e78d49 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/patchSchedulesListByRedisResourceSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all patch schedules in the specified redis cache (there is only one). + * + * @summary gets all patch schedules in the specified redis cache (there is only one). + * x-ms-original-file: 2024-11-01/RedisCachePatchSchedulesList.json + */ +async function redisCachePatchSchedulesList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.patchSchedules.listByRedisResource("rg1", "cache1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCachePatchSchedulesList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsDeleteSample.ts new file mode 100644 index 000000000000..944f73827bb5 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes the specified private endpoint connection associated with the redis cache. + * + * @summary deletes the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDeletePrivateEndpointConnection.json + */ +async function redisCacheDeletePrivateEndpointConnection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.privateEndpointConnections.delete("rgtest01", "cachetest01", "pectest01"); +} + +async function main(): Promise { + await redisCacheDeletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsGetSample.ts new file mode 100644 index 000000000000..e3a25211512d --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsGetSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the specified private endpoint connection associated with the redis cache. + * + * @summary gets the specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheGetPrivateEndpointConnection.json + */ +async function redisCacheGetPrivateEndpointConnection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.get( + "rgtest01", + "cachetest01", + "pectest01", + ); + console.log(result); +} + +async function main(): Promise { + await redisCacheGetPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsListSample.ts new file mode 100644 index 000000000000..45e2abc24d86 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsListSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to list all the private endpoint connections associated with the redis cache. + * + * @summary list all the private endpoint connections associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateEndpointConnections.json + */ +async function redisCacheListPrivateEndpointConnection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateEndpointConnections.list("rgtest01", "cachetest01")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheListPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsPutSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsPutSample.ts new file mode 100644 index 000000000000..bdf092ed550f --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateEndpointConnectionsPutSample.ts @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update the state of specified private endpoint connection associated with the redis cache. + * + * @summary update the state of specified private endpoint connection associated with the redis cache. + * x-ms-original-file: 2024-11-01/RedisCachePutPrivateEndpointConnection.json + */ +async function redisCachePutPrivateEndpointConnection(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.privateEndpointConnections.put( + "rgtest01", + "cachetest01", + "pectest01", + { + properties: { + privateLinkServiceConnectionState: { + description: "Auto-Approved", + status: "Approved", + }, + }, + }, + ); + console.log(result); +} + +async function main(): Promise { + await redisCachePutPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateLinkResourcesListByRedisCacheSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateLinkResourcesListByRedisCacheSample.ts new file mode 100644 index 000000000000..73cdbf382940 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/privateLinkResourcesListByRedisCacheSample.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets the private link resources that need to be created for a redis cache. + * + * @summary gets the private link resources that need to be created for a redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListPrivateLinkResources.json + */ +async function storageAccountListPrivateLinkResources(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.privateLinkResources.listByRedisCache( + "rgtest01", + "cacheTest01", + )) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await storageAccountListPrivateLinkResources(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCheckNameAvailabilitySample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCheckNameAvailabilitySample.ts new file mode 100644 index 000000000000..baf2194a26a2 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCheckNameAvailabilitySample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to checks that the redis cache name is valid and is not already in use. + * + * @summary checks that the redis cache name is valid and is not already in use. + * x-ms-original-file: 2024-11-01/RedisCacheCheckNameAvailability.json + */ +async function redisCacheCheckNameAvailability(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.checkNameAvailability({ + name: "cacheName", + type: "Microsoft.Cache/Redis", + }); +} + +async function main(): Promise { + await redisCacheCheckNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCreateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCreateSample.ts new file mode 100644 index 000000000000..f62c9d216f69 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisCreateSample.ts @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreate.json + */ +async function redisCacheCreate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "4", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateAutomaticZonalAllocationPolicy.json + */ +async function redisCacheCreateAutomaticZonalAllocationPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "Automatic", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateDefaultVersion.json + */ +async function redisCacheCreateDefaultVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateLatestVersion.json + */ +async function redisCacheCreateLatestVersion(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + }, + zones: ["1"], + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateNoZonesZonalAllocationPolicy.json + */ +async function redisCacheCreateNoZonesZonalAllocationPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "NoZones", + }, + }); + console.log(result); +} + +/** + * This sample demonstrates how to create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * + * @summary create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheCreateUserDefinedZonalAllocationPolicy.json + */ +async function redisCacheCreateUserDefinedZonalAllocationPolicy(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.create("rg1", "cache1", { + location: "East US", + properties: { + enableNonSslPort: true, + minimumTlsVersion: "1.2", + redisConfiguration: { maxmemoryPolicy: "allkeys-lru" }, + redisVersion: "Latest", + replicasPerPrimary: 2, + shardCount: 2, + sku: { name: "Premium", capacity: 1, family: "P" }, + staticIP: "192.168.0.5", + subnetId: + "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg2/providers/Microsoft.Network/virtualNetworks/network1/subnets/subnet1", + zonalAllocationPolicy: "UserDefined", + }, + zones: ["1"], + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheCreate(); + await redisCacheCreateAutomaticZonalAllocationPolicy(); + await redisCacheCreateDefaultVersion(); + await redisCacheCreateLatestVersion(); + await redisCacheCreateNoZonesZonalAllocationPolicy(); + await redisCacheCreateUserDefinedZonalAllocationPolicy(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisDeleteSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisDeleteSample.ts new file mode 100644 index 000000000000..e1dc594dd728 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisDeleteSample.ts @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes a Redis cache. + * + * @summary deletes a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheDelete.json + */ +async function redisCacheDelete(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.delete("rg1", "cache1"); +} + +async function main(): Promise { + await redisCacheDelete(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisExportDataSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisExportDataSample.ts new file mode 100644 index 000000000000..b53bafe137ad --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisExportDataSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to export data from the redis cache to blobs in a container. + * + * @summary export data from the redis cache to blobs in a container. + * x-ms-original-file: 2024-11-01/RedisCacheExport.json + */ +async function redisCacheExport(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.exportData("rg1", "cache1", { + format: "RDB", + container: "https://contosostorage.blob.core.window.net/urltoBlobContainer?sasKeyParameters", + prefix: "datadump1", + storageSubscriptionId: "storageSubId", + }); +} + +async function main(): Promise { + await redisCacheExport(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisFlushCacheSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisFlushCacheSample.ts new file mode 100644 index 000000000000..4d2436f04b21 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisFlushCacheSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to deletes all of the keys in a cache. + * + * @summary deletes all of the keys in a cache. + * x-ms-original-file: 2024-11-01/RedisCacheFlush.json + */ +async function redisCacheFlush(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.flushCache("resource-group-name", "cache-name"); + console.log(result); +} + +async function main(): Promise { + await redisCacheFlush(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisForceRebootSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisForceRebootSample.ts new file mode 100644 index 000000000000..3d70342df6e0 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisForceRebootSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * + * @summary reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. + * x-ms-original-file: 2024-11-01/RedisCacheForceReboot.json + */ +async function redisCacheForceReboot(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.forceReboot("rg1", "cache1", { + ports: [13000, 15001], + rebootType: "AllNodes", + shardId: 0, + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheForceReboot(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisGetSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisGetSample.ts new file mode 100644 index 000000000000..10e7b84f3dc4 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisGetSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets a Redis cache (resource description). + * + * @summary gets a Redis cache (resource description). + * x-ms-original-file: 2024-11-01/RedisCacheGet.json + */ +async function redisCacheGet(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.get("rg1", "cache1"); + console.log(result); +} + +async function main(): Promise { + await redisCacheGet(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisImportDataSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisImportDataSample.ts new file mode 100644 index 000000000000..9beaec88dbd1 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisImportDataSample.ts @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to import data into Redis cache. + * + * @summary import data into Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheImport.json + */ +async function redisCacheImport(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + await client.redis.importData("rg1", "cache1", { + format: "RDB", + files: ["http://fileuris.contoso.com/pathtofile1"], + storageSubscriptionId: "storageSubId", + }); +} + +async function main(): Promise { + await redisCacheImport(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListByResourceGroupSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListByResourceGroupSample.ts new file mode 100644 index 000000000000..d69074118bc1 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListByResourceGroupSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to lists all Redis caches in a resource group. + * + * @summary lists all Redis caches in a resource group. + * x-ms-original-file: 2024-11-01/RedisCacheListByResourceGroup.json + */ +async function redisCacheListByResourceGroup(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listByResourceGroup("rg1")) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheListByResourceGroup(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListBySubscriptionSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListBySubscriptionSample.ts new file mode 100644 index 000000000000..596ed21f8549 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListBySubscriptionSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to gets all Redis caches in the specified subscription. + * + * @summary gets all Redis caches in the specified subscription. + * x-ms-original-file: 2024-11-01/RedisCacheList.json + */ +async function redisCacheList(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listBySubscription()) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheList(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListKeysSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListKeysSample.ts new file mode 100644 index 000000000000..d20380d96698 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListKeysSample.ts @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheListKeys.json + */ +async function redisCacheListKeys(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.listKeys("rg1", "cache1"); + console.log(result); +} + +async function main(): Promise { + await redisCacheListKeys(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListUpgradeNotificationsSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListUpgradeNotificationsSample.ts new file mode 100644 index 000000000000..a67bdff1f624 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisListUpgradeNotificationsSample.ts @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to [Deprecated] Gets any upgrade notifications for a Redis cache. + * + * @summary [Deprecated] Gets any upgrade notifications for a Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheListUpgradeNotifications.json + */ +async function redisCacheListUpgradeNotifications(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const resArray = new Array(); + for await (const item of client.redis.listUpgradeNotifications("rg1", "cache1", 5000)) { + resArray.push(item); + } + + console.log(resArray); +} + +async function main(): Promise { + await redisCacheListUpgradeNotifications(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisRegenerateKeySample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisRegenerateKeySample.ts new file mode 100644 index 000000000000..dd28dbcd5ae2 --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisRegenerateKeySample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * + * @summary regenerate Redis cache's access keys. This operation requires write permission to the cache resource. + * x-ms-original-file: 2024-11-01/RedisCacheRegenerateKey.json + */ +async function redisCacheRegenerateKey(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.regenerateKey("rg1", "cache1", { + keyType: "Primary", + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheRegenerateKey(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisUpdateSample.ts b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisUpdateSample.ts new file mode 100644 index 000000000000..c08fab28453a --- /dev/null +++ b/sdk/redis/arm-rediscache/samples/v9/typescript/src/redisUpdateSample.ts @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { RedisManagementClient } from "@azure/arm-rediscache"; +import { DefaultAzureCredential } from "@azure/identity"; + +/** + * This sample demonstrates how to update an existing Redis cache. + * + * @summary update an existing Redis cache. + * x-ms-original-file: 2024-11-01/RedisCacheUpdate.json + */ +async function redisCacheUpdate(): Promise { + const credential = new DefaultAzureCredential(); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const client = new RedisManagementClient(credential, subscriptionId); + const result = await client.redis.update("rg1", "cache1", { + properties: { enableNonSslPort: true, replicasPerPrimary: 2 }, + }); + console.log(result); +} + +async function main(): Promise { + await redisCacheUpdate(); +} + +main().catch(console.error); diff --git a/sdk/redis/arm-rediscache/samples/v8/typescript/tsconfig.json b/sdk/redis/arm-rediscache/samples/v9/typescript/tsconfig.json similarity index 100% rename from sdk/redis/arm-rediscache/samples/v8/typescript/tsconfig.json rename to sdk/redis/arm-rediscache/samples/v9/typescript/tsconfig.json diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicy/index.ts b/sdk/redis/arm-rediscache/src/api/accessPolicy/index.ts new file mode 100644 index 000000000000..b5eb3a4738eb --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicy/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, createUpdate, get } from "./operations.js"; +export { + AccessPolicyListOptionalParams, + AccessPolicyDeleteOptionalParams, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicy/operations.ts b/sdk/redis/arm-rediscache/src/api/accessPolicy/operations.ts new file mode 100644 index 000000000000..6afe0279e445 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicy/operations.ts @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { RedisCacheAccessPolicy, _RedisCacheAccessPolicyList } from "../../models/models.js"; +import { + errorResponseDeserializer, + redisCacheAccessPolicySerializer, + redisCacheAccessPolicyDeserializer, + _redisCacheAccessPolicyListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + AccessPolicyListOptionalParams, + AccessPolicyDeleteOptionalParams, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: AccessPolicyListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisCacheAccessPolicyList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisCacheAccessPolicyListDeserializer(result.body); +} + +/** Gets the list of access policies associated with this redis cache */ +export function list( + context: Client, + resourceGroupName: string, + cacheName: string, + options: AccessPolicyListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, cacheName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options: AccessPolicyDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyName: accessPolicyName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the access policy from a redis cache */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options: AccessPolicyDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, cacheName, accessPolicyName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createUpdateSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options: AccessPolicyCreateUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyName: accessPolicyName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisCacheAccessPolicySerializer(parameters), + }); +} + +export async function _createUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisCacheAccessPolicyDeserializer(result.body); +} + +/** Adds an access policy to the redis cache */ +export function createUpdate( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options: AccessPolicyCreateUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, RedisCacheAccessPolicy> { + return getLongRunningPoller(context, _createUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createUpdateSend( + context, + resourceGroupName, + cacheName, + accessPolicyName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, RedisCacheAccessPolicy>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options: AccessPolicyGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyName: accessPolicyName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisCacheAccessPolicyDeserializer(result.body); +} + +/** Gets the detailed information about an access policy of a redis cache */ +export async function get( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options: AccessPolicyGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, cacheName, accessPolicyName, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicy/options.ts b/sdk/redis/arm-rediscache/src/api/accessPolicy/options.ts new file mode 100644 index 000000000000..9c6883a19633 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicy/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AccessPolicyListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AccessPolicyDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AccessPolicyCreateUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AccessPolicyGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/index.ts b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/index.ts new file mode 100644 index 000000000000..eb550b963b70 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, createUpdate, get } from "./operations.js"; +export { + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/operations.ts b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/operations.ts new file mode 100644 index 000000000000..3b4876fd1a0b --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/operations.ts @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { + RedisCacheAccessPolicyAssignment, + _RedisCacheAccessPolicyAssignmentList, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + redisCacheAccessPolicyAssignmentSerializer, + redisCacheAccessPolicyAssignmentDeserializer, + _redisCacheAccessPolicyAssignmentListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: AccessPolicyAssignmentListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisCacheAccessPolicyAssignmentList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisCacheAccessPolicyAssignmentListDeserializer(result.body); +} + +/** Gets the list of access policy assignments associated with this redis cache */ +export function list( + context: Client, + resourceGroupName: string, + cacheName: string, + options: AccessPolicyAssignmentListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, cacheName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options: AccessPolicyAssignmentDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyAssignmentName: accessPolicyAssignmentName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the access policy assignment from a redis cache */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options: AccessPolicyAssignmentDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, cacheName, accessPolicyAssignmentName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createUpdateSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + parameters: RedisCacheAccessPolicyAssignment, + options: AccessPolicyAssignmentCreateUpdateOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyAssignmentName: accessPolicyAssignmentName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisCacheAccessPolicyAssignmentSerializer(parameters), + }); +} + +export async function _createUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisCacheAccessPolicyAssignmentDeserializer(result.body); +} + +/** Adds the access policy assignment to the specified users */ +export function createUpdate( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + parameters: RedisCacheAccessPolicyAssignment, + options: AccessPolicyAssignmentCreateUpdateOptionalParams = { + requestOptions: {}, + }, +): PollerLike, RedisCacheAccessPolicyAssignment> { + return getLongRunningPoller(context, _createUpdateDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createUpdateSend( + context, + resourceGroupName, + cacheName, + accessPolicyAssignmentName, + parameters, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + RedisCacheAccessPolicyAssignment + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options: AccessPolicyAssignmentGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + accessPolicyAssignmentName: accessPolicyAssignmentName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisCacheAccessPolicyAssignmentDeserializer(result.body); +} + +/** Gets the list of assignments for an access policy of a redis cache */ +export async function get( + context: Client, + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options: AccessPolicyAssignmentGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + cacheName, + accessPolicyAssignmentName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/options.ts b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/options.ts new file mode 100644 index 000000000000..76ca26aa9e00 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/accessPolicyAssignment/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AccessPolicyAssignmentListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface AccessPolicyAssignmentDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AccessPolicyAssignmentCreateUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface AccessPolicyAssignmentGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/index.ts b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/index.ts new file mode 100644 index 000000000000..9c78f2db2cf9 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { get } from "./operations.js"; +export { AsyncOperationStatusGetOptionalParams } from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/operations.ts b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/operations.ts new file mode 100644 index 000000000000..dda3d130a797 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/operations.ts @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { OperationStatus } from "../../models/models.js"; +import { errorResponseDeserializer, operationStatusDeserializer } from "../../models/models.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { AsyncOperationStatusGetOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _getSend( + context: Client, + location: string, + operationId: string, + options: AsyncOperationStatusGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/asyncOperations/{operationId}{?api%2Dversion}", + { + location: location, + operationId: operationId, + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return operationStatusDeserializer(result.body); +} + +/** For checking the ongoing status of an operation */ +export async function get( + context: Client, + location: string, + operationId: string, + options: AsyncOperationStatusGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, location, operationId, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/options.ts b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/options.ts new file mode 100644 index 000000000000..ad5ab67ec014 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/asyncOperationStatus/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface AsyncOperationStatusGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/firewallRules/index.ts b/sdk/redis/arm-rediscache/src/api/firewallRules/index.ts new file mode 100644 index 000000000000..d6c9f8052a0c --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/firewallRules/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, createOrUpdate, get } from "./operations.js"; +export { + FirewallRulesListOptionalParams, + FirewallRulesDeleteOptionalParams, + FirewallRulesCreateOrUpdateOptionalParams, + FirewallRulesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/firewallRules/operations.ts b/sdk/redis/arm-rediscache/src/api/firewallRules/operations.ts new file mode 100644 index 000000000000..13194598ddb1 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/firewallRules/operations.ts @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { RedisFirewallRule, _RedisFirewallRuleListResult } from "../../models/models.js"; +import { + errorResponseDeserializer, + redisFirewallRuleSerializer, + redisFirewallRuleDeserializer, + _redisFirewallRuleListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + FirewallRulesListOptionalParams, + FirewallRulesDeleteOptionalParams, + FirewallRulesCreateOrUpdateOptionalParams, + FirewallRulesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: FirewallRulesListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisFirewallRuleListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisFirewallRuleListResultDeserializer(result.body); +} + +/** Gets all firewall rules in the specified redis cache. */ +export function list( + context: Client, + resourceGroupName: string, + cacheName: string, + options: FirewallRulesListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, cacheName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + options: FirewallRulesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + ruleName: ruleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a single firewall rule in a specified redis cache. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + options: FirewallRulesDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, cacheName, ruleName, options); + return _$deleteDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + parameters: RedisFirewallRule, + options: FirewallRulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + ruleName: ruleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisFirewallRuleSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisFirewallRuleDeserializer(result.body); +} + +/** Create or update a redis cache firewall rule */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + parameters: RedisFirewallRule, + options: FirewallRulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + cacheName, + ruleName, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + options: FirewallRulesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + ruleName: ruleName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisFirewallRuleDeserializer(result.body); +} + +/** Gets a single firewall rule in a specified redis cache. */ +export async function get( + context: Client, + resourceGroupName: string, + cacheName: string, + ruleName: string, + options: FirewallRulesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, cacheName, ruleName, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/firewallRules/options.ts b/sdk/redis/arm-rediscache/src/api/firewallRules/options.ts new file mode 100644 index 000000000000..b8f7300ee6ae --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/firewallRules/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface FirewallRulesListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FirewallRulesDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FirewallRulesCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface FirewallRulesGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/index.ts b/sdk/redis/arm-rediscache/src/api/index.ts new file mode 100644 index 000000000000..90af5eda2e33 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/index.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + createRedisManagement, + RedisManagementContext, + RedisManagementClientOptionalParams, +} from "./redisManagementContext.js"; diff --git a/sdk/redis/arm-rediscache/src/api/linkedServer/index.ts b/sdk/redis/arm-rediscache/src/api/linkedServer/index.ts new file mode 100644 index 000000000000..fb9714c48d0e --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/linkedServer/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, create, get } from "./operations.js"; +export { + LinkedServerListOptionalParams, + LinkedServerDeleteOptionalParams, + LinkedServerCreateOptionalParams, + LinkedServerGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/linkedServer/operations.ts b/sdk/redis/arm-rediscache/src/api/linkedServer/operations.ts new file mode 100644 index 000000000000..639d45c7d3ca --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/linkedServer/operations.ts @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { + RedisLinkedServerWithProperties, + RedisLinkedServerCreateParameters, + _RedisLinkedServerWithPropertiesList, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + redisLinkedServerWithPropertiesDeserializer, + redisLinkedServerCreateParametersSerializer, + _redisLinkedServerWithPropertiesListDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + LinkedServerListOptionalParams, + LinkedServerDeleteOptionalParams, + LinkedServerCreateOptionalParams, + LinkedServerGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + name: string, + options: LinkedServerListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisLinkedServerWithPropertiesList> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisLinkedServerWithPropertiesListDeserializer(result.body); +} + +/** Gets the list of linked servers associated with this redis cache (requires Premium SKU). */ +export function list( + context: Client, + resourceGroupName: string, + name: string, + options: LinkedServerListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, name, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + options: LinkedServerDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + linkedServerName: linkedServerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the linked server from a redis cache (requires Premium SKU). */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + options: LinkedServerDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _$deleteSend(context, resourceGroupName, name, linkedServerName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + parameters: RedisLinkedServerCreateParameters, + options: LinkedServerCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + linkedServerName: linkedServerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisLinkedServerCreateParametersSerializer(parameters), + }); +} + +export async function _createDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisLinkedServerWithPropertiesDeserializer(result.body); +} + +/** Adds a linked server to the Redis cache (requires Premium SKU). */ +export function create( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + parameters: RedisLinkedServerCreateParameters, + options: LinkedServerCreateOptionalParams = { requestOptions: {} }, +): PollerLike, RedisLinkedServerWithProperties> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _createSend(context, resourceGroupName, name, linkedServerName, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike< + OperationState, + RedisLinkedServerWithProperties + >; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + options: LinkedServerGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + linkedServerName: linkedServerName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisLinkedServerWithPropertiesDeserializer(result.body); +} + +/** Gets the detailed information about a linked server of a redis cache (requires Premium SKU). */ +export async function get( + context: Client, + resourceGroupName: string, + name: string, + linkedServerName: string, + options: LinkedServerGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, name, linkedServerName, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/linkedServer/options.ts b/sdk/redis/arm-rediscache/src/api/linkedServer/options.ts new file mode 100644 index 000000000000..905450090d39 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/linkedServer/options.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface LinkedServerListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface LinkedServerDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LinkedServerCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface LinkedServerGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/operations/index.ts b/sdk/redis/arm-rediscache/src/api/operations/index.ts new file mode 100644 index 000000000000..24a804d14fcf --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/operations/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list } from "./operations.js"; +export { OperationsListOptionalParams } from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/operations/operations.ts b/sdk/redis/arm-rediscache/src/api/operations/operations.ts new file mode 100644 index 000000000000..e43c6e48756f --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/operations/operations.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { _OperationListResult, Operation } from "../../models/models.js"; +import { + _operationListResultDeserializer, + errorResponseDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { OperationsListOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listSend( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/providers/Microsoft.Cache/operations{?api%2Dversion}", + { + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_OperationListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _operationListResultDeserializer(result.body); +} + +/** List the operations for the provider */ +export function list( + context: Client, + options: OperationsListOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/redis/arm-rediscache/src/api/operations/options.ts b/sdk/redis/arm-rediscache/src/api/operations/options.ts new file mode 100644 index 000000000000..b9a3fd9758a3 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/operations/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/patchSchedules/index.ts b/sdk/redis/arm-rediscache/src/api/patchSchedules/index.ts new file mode 100644 index 000000000000..0c201b62dca9 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/patchSchedules/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByRedisResource, $delete, createOrUpdate, get } from "./operations.js"; +export { + PatchSchedulesListByRedisResourceOptionalParams, + PatchSchedulesDeleteOptionalParams, + PatchSchedulesCreateOrUpdateOptionalParams, + PatchSchedulesGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/patchSchedules/operations.ts b/sdk/redis/arm-rediscache/src/api/patchSchedules/operations.ts new file mode 100644 index 000000000000..7a1e4677266d --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/patchSchedules/operations.ts @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { + RedisPatchSchedule, + DefaultName, + _RedisPatchScheduleListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + redisPatchScheduleSerializer, + redisPatchScheduleDeserializer, + _redisPatchScheduleListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + PatchSchedulesListByRedisResourceOptionalParams, + PatchSchedulesDeleteOptionalParams, + PatchSchedulesCreateOrUpdateOptionalParams, + PatchSchedulesGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByRedisResourceSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PatchSchedulesListByRedisResourceOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/patchSchedules{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByRedisResourceDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisPatchScheduleListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisPatchScheduleListResultDeserializer(result.body); +} + +/** Gets all patch schedules in the specified redis cache (there is only one). */ +export function listByRedisResource( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PatchSchedulesListByRedisResourceOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByRedisResourceSend(context, resourceGroupName, cacheName, options), + _listByRedisResourceDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options: PatchSchedulesDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + default: defaultParam, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the patching schedule of a redis cache. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options: PatchSchedulesDeleteOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _$deleteSend(context, resourceGroupName, name, defaultParam, options); + return _$deleteDeserialize(result); +} + +export function _createOrUpdateSend( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + parameters: RedisPatchSchedule, + options: PatchSchedulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + default: defaultParam, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisPatchScheduleSerializer(parameters), + }); +} + +export async function _createOrUpdateDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisPatchScheduleDeserializer(result.body); +} + +/** Create or replace the patching schedule for Redis cache. */ +export async function createOrUpdate( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + parameters: RedisPatchSchedule, + options: PatchSchedulesCreateOrUpdateOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _createOrUpdateSend( + context, + resourceGroupName, + name, + defaultParam, + parameters, + options, + ); + return _createOrUpdateDeserialize(result); +} + +export function _getSend( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options: PatchSchedulesGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + default: defaultParam, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisPatchScheduleDeserializer(result.body); +} + +/** Gets the patching schedule of a redis cache. */ +export async function get( + context: Client, + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options: PatchSchedulesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, name, defaultParam, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/patchSchedules/options.ts b/sdk/redis/arm-rediscache/src/api/patchSchedules/options.ts new file mode 100644 index 000000000000..e261cdc9f714 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/patchSchedules/options.ts @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PatchSchedulesListByRedisResourceOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PatchSchedulesDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PatchSchedulesCreateOrUpdateOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PatchSchedulesGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/index.ts b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..0c89673887df --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/index.ts @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { list, $delete, put, get } from "./operations.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/operations.ts b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/operations.ts new file mode 100644 index 000000000000..20ede9993965 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/operations.ts @@ -0,0 +1,278 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { + PrivateEndpointConnection, + _PrivateEndpointConnectionListResult, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + privateEndpointConnectionSerializer, + privateEndpointConnectionDeserializer, + _privateEndpointConnectionListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _listSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateEndpointConnectionListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _privateEndpointConnectionListResultDeserializer(result.body); +} + +/** List all the private endpoint connections associated with the redis cache. */ +export function list( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PrivateEndpointConnectionsListOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listSend(context, resourceGroupName, cacheName, options), + _listDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes the specified private endpoint connection associated with the redis cache. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export async function $delete( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsDeleteOptionalParams = { + requestOptions: {}, + }, +): Promise { + const result = await _$deleteSend( + context, + resourceGroupName, + cacheName, + privateEndpointConnectionName, + options, + ); + return _$deleteDeserialize(result); +} + +export function _putSend( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options: PrivateEndpointConnectionsPutOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: privateEndpointConnectionSerializer(properties), + }); +} + +export async function _putDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Update the state of specified private endpoint connection associated with the redis cache. */ +export function put( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options: PrivateEndpointConnectionsPutOptionalParams = { requestOptions: {} }, +): PollerLike, PrivateEndpointConnection> { + return getLongRunningPoller(context, _putDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _putSend( + context, + resourceGroupName, + cacheName, + privateEndpointConnectionName, + properties, + options, + ), + resourceLocationConfig: "location", + }) as PollerLike, PrivateEndpointConnection>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + privateEndpointConnectionName: privateEndpointConnectionName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return privateEndpointConnectionDeserializer(result.body); +} + +/** Gets the specified private endpoint connection associated with the redis cache. */ +export async function get( + context: Client, + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options: PrivateEndpointConnectionsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend( + context, + resourceGroupName, + cacheName, + privateEndpointConnectionName, + options, + ); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/options.ts b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/options.ts new file mode 100644 index 000000000000..64f6a09b2a78 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateEndpointConnections/options.ts @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsListOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsDeleteOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsPutOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface PrivateEndpointConnectionsGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/privateLinkResources/index.ts b/sdk/redis/arm-rediscache/src/api/privateLinkResources/index.ts new file mode 100644 index 000000000000..28f055ba2c0a --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateLinkResources/index.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { listByRedisCache } from "./operations.js"; +export { PrivateLinkResourcesListByRedisCacheOptionalParams } from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/privateLinkResources/operations.ts b/sdk/redis/arm-rediscache/src/api/privateLinkResources/operations.ts new file mode 100644 index 000000000000..46a99ac9cb81 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateLinkResources/operations.ts @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { _PrivateLinkResourceListResult, PrivateLinkResource } from "../../models/models.js"; +import { + errorResponseDeserializer, + _privateLinkResourceListResultDeserializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { PrivateLinkResourcesListByRedisCacheOptionalParams } from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; + +export function _listByRedisCacheSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PrivateLinkResourcesListByRedisCacheOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateLinkResources{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByRedisCacheDeserialize( + result: PathUncheckedResponse, +): Promise<_PrivateLinkResourceListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _privateLinkResourceListResultDeserializer(result.body); +} + +/** Gets the private link resources that need to be created for a redis cache. */ +export function listByRedisCache( + context: Client, + resourceGroupName: string, + cacheName: string, + options: PrivateLinkResourcesListByRedisCacheOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByRedisCacheSend(context, resourceGroupName, cacheName, options), + _listByRedisCacheDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} diff --git a/sdk/redis/arm-rediscache/src/api/privateLinkResources/options.ts b/sdk/redis/arm-rediscache/src/api/privateLinkResources/options.ts new file mode 100644 index 000000000000..e82e47659c28 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/privateLinkResources/options.ts @@ -0,0 +1,7 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface PrivateLinkResourcesListByRedisCacheOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/redis/index.ts b/sdk/redis/arm-rediscache/src/api/redis/index.ts new file mode 100644 index 000000000000..c28a49b4f581 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/redis/index.ts @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + checkNameAvailability, + flushCache, + exportData, + importData, + forceReboot, + regenerateKey, + listKeys, + listUpgradeNotifications, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "./operations.js"; +export { + RedisCheckNameAvailabilityOptionalParams, + RedisFlushCacheOptionalParams, + RedisExportDataOptionalParams, + RedisImportDataOptionalParams, + RedisForceRebootOptionalParams, + RedisRegenerateKeyOptionalParams, + RedisListKeysOptionalParams, + RedisListUpgradeNotificationsOptionalParams, + RedisListBySubscriptionOptionalParams, + RedisListByResourceGroupOptionalParams, + RedisDeleteOptionalParams, + RedisUpdateOptionalParams, + RedisCreateOptionalParams, + RedisGetOptionalParams, +} from "./options.js"; diff --git a/sdk/redis/arm-rediscache/src/api/redis/operations.ts b/sdk/redis/arm-rediscache/src/api/redis/operations.ts new file mode 100644 index 000000000000..d8969983ba1d --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/redis/operations.ts @@ -0,0 +1,805 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext as Client } from "../index.js"; +import type { + RedisResource, + RedisAccessKeys, + RedisCreateParameters, + RedisUpdateParameters, + _RedisListResult, + _NotificationListResponse, + UpgradeNotification, + RedisRegenerateKeyParameters, + RedisRebootParameters, + RedisForceRebootResponse, + ImportRDBParameters, + ExportRDBParameters, + OperationStatusResult, + CheckNameAvailabilityParameters, +} from "../../models/models.js"; +import { + errorResponseDeserializer, + redisResourceDeserializer, + redisAccessKeysDeserializer, + redisCreateParametersSerializer, + redisUpdateParametersSerializer, + _redisListResultDeserializer, + _notificationListResponseDeserializer, + redisRegenerateKeyParametersSerializer, + redisRebootParametersSerializer, + redisForceRebootResponseDeserializer, + importRDBParametersSerializer, + exportRDBParametersSerializer, + operationStatusResultDeserializer, + checkNameAvailabilityParametersSerializer, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import { buildPagedAsyncIterator } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; +import { expandUrlTemplate } from "../../static-helpers/urlTemplate.js"; +import type { + RedisCheckNameAvailabilityOptionalParams, + RedisFlushCacheOptionalParams, + RedisExportDataOptionalParams, + RedisImportDataOptionalParams, + RedisForceRebootOptionalParams, + RedisRegenerateKeyOptionalParams, + RedisListKeysOptionalParams, + RedisListUpgradeNotificationsOptionalParams, + RedisListBySubscriptionOptionalParams, + RedisListByResourceGroupOptionalParams, + RedisDeleteOptionalParams, + RedisUpdateOptionalParams, + RedisCreateOptionalParams, + RedisGetOptionalParams, +} from "./options.js"; +import type { StreamableMethod, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError, operationOptionsToRequestParameters } from "@azure-rest/core-client"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +export function _checkNameAvailabilitySend( + context: Client, + parameters: CheckNameAvailabilityParameters, + options: RedisCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/checkNameAvailability{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: checkNameAvailabilityParametersSerializer(parameters), + }); +} + +export async function _checkNameAvailabilityDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Checks that the redis cache name is valid and is not already in use. */ +export async function checkNameAvailability( + context: Client, + parameters: CheckNameAvailabilityParameters, + options: RedisCheckNameAvailabilityOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _checkNameAvailabilitySend(context, parameters, options); + return _checkNameAvailabilityDeserialize(result); +} + +export function _flushCacheSend( + context: Client, + resourceGroupName: string, + cacheName: string, + options: RedisFlushCacheOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/flush{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + cacheName: cacheName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _flushCacheDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return operationStatusResultDeserializer(result.body); +} + +/** Deletes all of the keys in a cache. */ +export function flushCache( + context: Client, + resourceGroupName: string, + cacheName: string, + options: RedisFlushCacheOptionalParams = { requestOptions: {} }, +): PollerLike, OperationStatusResult> { + return getLongRunningPoller(context, _flushCacheDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _flushCacheSend(context, resourceGroupName, cacheName, options), + resourceLocationConfig: "location", + }) as PollerLike, OperationStatusResult>; +} + +export function _exportDataSend( + context: Client, + resourceGroupName: string, + name: string, + parameters: ExportRDBParameters, + options: RedisExportDataOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/export{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: exportRDBParametersSerializer(parameters), + }); +} + +export async function _exportDataDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Export data from the redis cache to blobs in a container. */ +export function exportData( + context: Client, + resourceGroupName: string, + name: string, + parameters: ExportRDBParameters, + options: RedisExportDataOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _exportDataDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _exportDataSend(context, resourceGroupName, name, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _importDataSend( + context: Client, + resourceGroupName: string, + name: string, + parameters: ImportRDBParameters, + options: RedisImportDataOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/import{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + body: importRDBParametersSerializer(parameters), + }); +} + +export async function _importDataDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Import data into Redis cache. */ +export function importData( + context: Client, + resourceGroupName: string, + name: string, + parameters: ImportRDBParameters, + options: RedisImportDataOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _importDataDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => + _importDataSend(context, resourceGroupName, name, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _forceRebootSend( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisRebootParameters, + options: RedisForceRebootOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/forceReboot{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisRebootParametersSerializer(parameters), + }); +} + +export async function _forceRebootDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisForceRebootResponseDeserializer(result.body); +} + +/** Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. */ +export async function forceReboot( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisRebootParameters, + options: RedisForceRebootOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _forceRebootSend(context, resourceGroupName, name, parameters, options); + return _forceRebootDeserialize(result); +} + +export function _regenerateKeySend( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisRegenerateKeyParameters, + options: RedisRegenerateKeyOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/regenerateKey{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisRegenerateKeyParametersSerializer(parameters), + }); +} + +export async function _regenerateKeyDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisAccessKeysDeserializer(result.body); +} + +/** Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. */ +export async function regenerateKey( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisRegenerateKeyParameters, + options: RedisRegenerateKeyOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _regenerateKeySend(context, resourceGroupName, name, parameters, options); + return _regenerateKeyDeserialize(result); +} + +export function _listKeysSend( + context: Client, + resourceGroupName: string, + name: string, + options: RedisListKeysOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listKeys{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).post({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listKeysDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisAccessKeysDeserializer(result.body); +} + +/** Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. */ +export async function listKeys( + context: Client, + resourceGroupName: string, + name: string, + options: RedisListKeysOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _listKeysSend(context, resourceGroupName, name, options); + return _listKeysDeserialize(result); +} + +export function _listUpgradeNotificationsSend( + context: Client, + resourceGroupName: string, + name: string, + history: number, + options: RedisListUpgradeNotificationsOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listUpgradeNotifications{?api%2Dversion,history}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + history: history, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listUpgradeNotificationsDeserialize( + result: PathUncheckedResponse, +): Promise<_NotificationListResponse> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _notificationListResponseDeserializer(result.body); +} + +/** [Deprecated] Gets any upgrade notifications for a Redis cache. */ +export function listUpgradeNotifications( + context: Client, + resourceGroupName: string, + name: string, + history: number, + options: RedisListUpgradeNotificationsOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listUpgradeNotificationsSend(context, resourceGroupName, name, history, options), + _listUpgradeNotificationsDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listBySubscriptionSend( + context: Client, + options: RedisListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redis{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisListResultDeserializer(result.body); +} + +/** Gets all Redis caches in the specified subscription. */ +export function listBySubscription( + context: Client, + options: RedisListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listBySubscriptionSend(context, options), + _listBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _listByResourceGroupSend( + context: Client, + resourceGroupName: string, + options: RedisListByResourceGroupOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _listByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_RedisListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _redisListResultDeserializer(result.body); +} + +/** Lists all Redis caches in a resource group. */ +export function listByResourceGroup( + context: Client, + resourceGroupName: string, + options: RedisListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _listByResourceGroupSend(context, resourceGroupName, options), + _listByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _$deleteSend( + context: Client, + resourceGroupName: string, + name: string, + options: RedisDeleteOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).delete({ ...operationOptionsToRequestParameters(options) }); +} + +export async function _$deleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202", "204"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return; +} + +/** Deletes a Redis cache. */ +/** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ +export function $delete( + context: Client, + resourceGroupName: string, + name: string, + options: RedisDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _$deleteDeserialize, ["200", "202", "204"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _$deleteSend(context, resourceGroupName, name, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; +} + +export function _updateSend( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisUpdateParameters, + options: RedisUpdateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).patch({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisUpdateParametersSerializer(parameters), + }); +} + +export async function _updateDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisResourceDeserializer(result.body); +} + +/** Update an existing Redis cache. */ +export function update( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisUpdateParameters, + options: RedisUpdateOptionalParams = { requestOptions: {} }, +): PollerLike, RedisResource> { + return getLongRunningPoller(context, _updateDeserialize, ["200", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _updateSend(context, resourceGroupName, name, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, RedisResource>; +} + +export function _createSend( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisCreateParameters, + options: RedisCreateOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + body: redisCreateParametersSerializer(parameters), + }); +} + +export async function _createDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200", "201", "202"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisResourceDeserializer(result.body); +} + +/** Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. */ +export function create( + context: Client, + resourceGroupName: string, + name: string, + parameters: RedisCreateParameters, + options: RedisCreateOptionalParams = { requestOptions: {} }, +): PollerLike, RedisResource> { + return getLongRunningPoller(context, _createDeserialize, ["200", "201", "202"], { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + getInitialResponse: () => _createSend(context, resourceGroupName, name, parameters, options), + resourceLocationConfig: "location", + }) as PollerLike, RedisResource>; +} + +export function _getSend( + context: Client, + resourceGroupName: string, + name: string, + options: RedisGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + const path = expandUrlTemplate( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}{?api%2Dversion}", + { + subscriptionId: context.subscriptionId, + resourceGroupName: resourceGroupName, + name: name, + "api%2Dversion": context.apiVersion, + }, + { + allowReserved: options?.requestOptions?.skipUrlEncoding, + }, + ); + return context.path(path).get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + }); +} + +export async function _getDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return redisResourceDeserializer(result.body); +} + +/** Gets a Redis cache (resource description). */ +export async function get( + context: Client, + resourceGroupName: string, + name: string, + options: RedisGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _getSend(context, resourceGroupName, name, options); + return _getDeserialize(result); +} diff --git a/sdk/redis/arm-rediscache/src/api/redis/options.ts b/sdk/redis/arm-rediscache/src/api/redis/options.ts new file mode 100644 index 000000000000..cbaf3a163cc2 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/redis/options.ts @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { OperationOptions } from "@azure-rest/core-client"; + +/** Optional parameters. */ +export interface RedisCheckNameAvailabilityOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisFlushCacheOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisExportDataOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisImportDataOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisForceRebootOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisRegenerateKeyOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisListKeysOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisListUpgradeNotificationsOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisListBySubscriptionOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisListByResourceGroupOptionalParams extends OperationOptions {} + +/** Optional parameters. */ +export interface RedisDeleteOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisUpdateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisCreateOptionalParams extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; +} + +/** Optional parameters. */ +export interface RedisGetOptionalParams extends OperationOptions {} diff --git a/sdk/redis/arm-rediscache/src/api/redisManagementContext.ts b/sdk/redis/arm-rediscache/src/api/redisManagementContext.ts new file mode 100644 index 000000000000..7d2a396ce98f --- /dev/null +++ b/sdk/redis/arm-rediscache/src/api/redisManagementContext.ts @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { logger } from "../logger.js"; +import { KnownVersions } from "../models/models.js"; +import type { AzureSupportedClouds } from "../static-helpers/cloudSettingHelpers.js"; +import { getArmEndpoint } from "../static-helpers/cloudSettingHelpers.js"; +import type { Client, ClientOptions } from "@azure-rest/core-client"; +import { getClient } from "@azure-rest/core-client"; +import type { TokenCredential } from "@azure/core-auth"; + +/** REST API for Azure Redis Cache Service. */ +export interface RedisManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} + +/** Optional parameters for the client. */ +export interface RedisManagementClientOptionalParams extends ClientOptions { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion?: string; + /** Specifies the Azure cloud environment for the client. */ + cloudSetting?: AzureSupportedClouds; +} + +/** REST API for Azure Redis Cache Service. */ +export function createRedisManagement( + credential: TokenCredential, + subscriptionId: string, + options: RedisManagementClientOptionalParams = {}, +): RedisManagementContext { + const endpointUrl = + options.endpoint ?? getArmEndpoint(options.cloudSetting) ?? "https://management.azure.com"; + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentInfo = `azsdk-js-arm-rediscache/1.0.0-beta.1`; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` + : `azsdk-js-api ${userAgentInfo}`; + const { apiVersion: _, ...updatedOptions } = { + ...options, + userAgentOptions: { userAgentPrefix }, + loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info }, + credentials: { + scopes: options.credentials?.scopes ?? [`${endpointUrl}/.default`], + }, + }; + const clientContext = getClient(endpointUrl, credential, updatedOptions); + clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); + const apiVersion = options.apiVersion ?? "2024-11-01"; + clientContext.pipeline.addPolicy({ + name: "ClientApiVersionPolicy", + sendRequest: (req, next) => { + // Use the apiVersion defined in request url directly + // Append one if there is no apiVersion and we have one at client options + const url = new URL(req.url); + if (!url.searchParams.get("api-version")) { + req.url = `${req.url}${ + Array.from(url.searchParams.keys()).length > 0 ? "&" : "?" + }api-version=${apiVersion}`; + } + + return next(req); + }, + }); + return { + ...clientContext, + apiVersion, + subscriptionId, + } as RedisManagementContext; +} diff --git a/sdk/redis/arm-rediscache/src/classic/accessPolicy/index.ts b/sdk/redis/arm-rediscache/src/classic/accessPolicy/index.ts new file mode 100644 index 000000000000..1f284f0b204a --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/accessPolicy/index.ts @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list, $delete, createUpdate, get } from "../../api/accessPolicy/operations.js"; +import type { + AccessPolicyListOptionalParams, + AccessPolicyDeleteOptionalParams, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyGetOptionalParams, +} from "../../api/accessPolicy/options.js"; +import type { RedisCacheAccessPolicy } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a AccessPolicy operations. */ +export interface AccessPolicyOperations { + /** Gets the list of access policies associated with this redis cache */ + list: ( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the access policy from a redis cache */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams, + ) => PollerLike, void>; + /** Adds an access policy to the redis cache */ + createUpdate: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams, + ) => PollerLike, RedisCacheAccessPolicy>; + /** Gets the detailed information about an access policy of a redis cache */ + get: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyGetOptionalParams, + ) => Promise; +} + +function _getAccessPolicy(context: RedisManagementContext) { + return { + list: ( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyListOptionalParams, + ) => list(context, resourceGroupName, cacheName, options), + delete: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyDeleteOptionalParams, + ) => $delete(context, resourceGroupName, cacheName, accessPolicyName, options), + createUpdate: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + parameters: RedisCacheAccessPolicy, + options?: AccessPolicyCreateUpdateOptionalParams, + ) => createUpdate(context, resourceGroupName, cacheName, accessPolicyName, parameters, options), + get: ( + resourceGroupName: string, + cacheName: string, + accessPolicyName: string, + options?: AccessPolicyGetOptionalParams, + ) => get(context, resourceGroupName, cacheName, accessPolicyName, options), + }; +} + +export function _getAccessPolicyOperations( + context: RedisManagementContext, +): AccessPolicyOperations { + return { + ..._getAccessPolicy(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/accessPolicyAssignment/index.ts b/sdk/redis/arm-rediscache/src/classic/accessPolicyAssignment/index.ts new file mode 100644 index 000000000000..6e05e575dc4f --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/accessPolicyAssignment/index.ts @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list, $delete, createUpdate, get } from "../../api/accessPolicyAssignment/operations.js"; +import type { + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentGetOptionalParams, +} from "../../api/accessPolicyAssignment/options.js"; +import type { RedisCacheAccessPolicyAssignment } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a AccessPolicyAssignment operations. */ +export interface AccessPolicyAssignmentOperations { + /** Gets the list of access policy assignments associated with this redis cache */ + list: ( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the access policy assignment from a redis cache */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams, + ) => PollerLike, void>; + /** Adds the access policy assignment to the specified users */ + createUpdate: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + parameters: RedisCacheAccessPolicyAssignment, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams, + ) => PollerLike< + OperationState, + RedisCacheAccessPolicyAssignment + >; + /** Gets the list of assignments for an access policy of a redis cache */ + get: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options?: AccessPolicyAssignmentGetOptionalParams, + ) => Promise; +} + +function _getAccessPolicyAssignment(context: RedisManagementContext) { + return { + list: ( + resourceGroupName: string, + cacheName: string, + options?: AccessPolicyAssignmentListOptionalParams, + ) => list(context, resourceGroupName, cacheName, options), + delete: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options?: AccessPolicyAssignmentDeleteOptionalParams, + ) => $delete(context, resourceGroupName, cacheName, accessPolicyAssignmentName, options), + createUpdate: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + parameters: RedisCacheAccessPolicyAssignment, + options?: AccessPolicyAssignmentCreateUpdateOptionalParams, + ) => + createUpdate( + context, + resourceGroupName, + cacheName, + accessPolicyAssignmentName, + parameters, + options, + ), + get: ( + resourceGroupName: string, + cacheName: string, + accessPolicyAssignmentName: string, + options?: AccessPolicyAssignmentGetOptionalParams, + ) => get(context, resourceGroupName, cacheName, accessPolicyAssignmentName, options), + }; +} + +export function _getAccessPolicyAssignmentOperations( + context: RedisManagementContext, +): AccessPolicyAssignmentOperations { + return { + ..._getAccessPolicyAssignment(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/asyncOperationStatus/index.ts b/sdk/redis/arm-rediscache/src/classic/asyncOperationStatus/index.ts new file mode 100644 index 000000000000..4ba775f6e7ef --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/asyncOperationStatus/index.ts @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { get } from "../../api/asyncOperationStatus/operations.js"; +import type { AsyncOperationStatusGetOptionalParams } from "../../api/asyncOperationStatus/options.js"; +import type { OperationStatus } from "../../models/models.js"; + +/** Interface representing a AsyncOperationStatus operations. */ +export interface AsyncOperationStatusOperations { + /** For checking the ongoing status of an operation */ + get: ( + location: string, + operationId: string, + options?: AsyncOperationStatusGetOptionalParams, + ) => Promise; +} + +function _getAsyncOperationStatus(context: RedisManagementContext) { + return { + get: (location: string, operationId: string, options?: AsyncOperationStatusGetOptionalParams) => + get(context, location, operationId, options), + }; +} + +export function _getAsyncOperationStatusOperations( + context: RedisManagementContext, +): AsyncOperationStatusOperations { + return { + ..._getAsyncOperationStatus(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/firewallRules/index.ts b/sdk/redis/arm-rediscache/src/classic/firewallRules/index.ts new file mode 100644 index 000000000000..e4a81ba07827 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/firewallRules/index.ts @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list, $delete, createOrUpdate, get } from "../../api/firewallRules/operations.js"; +import type { + FirewallRulesListOptionalParams, + FirewallRulesDeleteOptionalParams, + FirewallRulesCreateOrUpdateOptionalParams, + FirewallRulesGetOptionalParams, +} from "../../api/firewallRules/options.js"; +import type { RedisFirewallRule } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a FirewallRules operations. */ +export interface FirewallRulesOperations { + /** Gets all firewall rules in the specified redis cache. */ + list: ( + resourceGroupName: string, + cacheName: string, + options?: FirewallRulesListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a single firewall rule in a specified redis cache. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + options?: FirewallRulesDeleteOptionalParams, + ) => Promise; + /** Create or update a redis cache firewall rule */ + createOrUpdate: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + parameters: RedisFirewallRule, + options?: FirewallRulesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets a single firewall rule in a specified redis cache. */ + get: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + options?: FirewallRulesGetOptionalParams, + ) => Promise; +} + +function _getFirewallRules(context: RedisManagementContext) { + return { + list: ( + resourceGroupName: string, + cacheName: string, + options?: FirewallRulesListOptionalParams, + ) => list(context, resourceGroupName, cacheName, options), + delete: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + options?: FirewallRulesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, cacheName, ruleName, options), + createOrUpdate: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + parameters: RedisFirewallRule, + options?: FirewallRulesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, cacheName, ruleName, parameters, options), + get: ( + resourceGroupName: string, + cacheName: string, + ruleName: string, + options?: FirewallRulesGetOptionalParams, + ) => get(context, resourceGroupName, cacheName, ruleName, options), + }; +} + +export function _getFirewallRulesOperations( + context: RedisManagementContext, +): FirewallRulesOperations { + return { + ..._getFirewallRules(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/index.ts b/sdk/redis/arm-rediscache/src/classic/index.ts new file mode 100644 index 000000000000..7494055f4e09 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/index.ts @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { AccessPolicyOperations } from "./accessPolicy/index.js"; +export { AccessPolicyAssignmentOperations } from "./accessPolicyAssignment/index.js"; +export { AsyncOperationStatusOperations } from "./asyncOperationStatus/index.js"; +export { FirewallRulesOperations } from "./firewallRules/index.js"; +export { LinkedServerOperations } from "./linkedServer/index.js"; +export { OperationsOperations } from "./operations/index.js"; +export { PatchSchedulesOperations } from "./patchSchedules/index.js"; +export { PrivateEndpointConnectionsOperations } from "./privateEndpointConnections/index.js"; +export { PrivateLinkResourcesOperations } from "./privateLinkResources/index.js"; +export { RedisOperations } from "./redis/index.js"; diff --git a/sdk/redis/arm-rediscache/src/classic/linkedServer/index.ts b/sdk/redis/arm-rediscache/src/classic/linkedServer/index.ts new file mode 100644 index 000000000000..c22e11cd6463 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/linkedServer/index.ts @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list, $delete, create, get } from "../../api/linkedServer/operations.js"; +import type { + LinkedServerListOptionalParams, + LinkedServerDeleteOptionalParams, + LinkedServerCreateOptionalParams, + LinkedServerGetOptionalParams, +} from "../../api/linkedServer/options.js"; +import type { + RedisLinkedServerWithProperties, + RedisLinkedServerCreateParameters, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a LinkedServer operations. */ +export interface LinkedServerOperations { + /** Gets the list of linked servers associated with this redis cache (requires Premium SKU). */ + list: ( + resourceGroupName: string, + name: string, + options?: LinkedServerListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the linked server from a redis cache (requires Premium SKU). */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + options?: LinkedServerDeleteOptionalParams, + ) => PollerLike, void>; + /** Adds a linked server to the Redis cache (requires Premium SKU). */ + create: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + parameters: RedisLinkedServerCreateParameters, + options?: LinkedServerCreateOptionalParams, + ) => PollerLike, RedisLinkedServerWithProperties>; + /** Gets the detailed information about a linked server of a redis cache (requires Premium SKU). */ + get: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + options?: LinkedServerGetOptionalParams, + ) => Promise; +} + +function _getLinkedServer(context: RedisManagementContext) { + return { + list: (resourceGroupName: string, name: string, options?: LinkedServerListOptionalParams) => + list(context, resourceGroupName, name, options), + delete: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + options?: LinkedServerDeleteOptionalParams, + ) => $delete(context, resourceGroupName, name, linkedServerName, options), + create: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + parameters: RedisLinkedServerCreateParameters, + options?: LinkedServerCreateOptionalParams, + ) => create(context, resourceGroupName, name, linkedServerName, parameters, options), + get: ( + resourceGroupName: string, + name: string, + linkedServerName: string, + options?: LinkedServerGetOptionalParams, + ) => get(context, resourceGroupName, name, linkedServerName, options), + }; +} + +export function _getLinkedServerOperations( + context: RedisManagementContext, +): LinkedServerOperations { + return { + ..._getLinkedServer(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/operations/index.ts b/sdk/redis/arm-rediscache/src/classic/operations/index.ts new file mode 100644 index 000000000000..2e8e1731633d --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/operations/index.ts @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list } from "../../api/operations/operations.js"; +import type { OperationsListOptionalParams } from "../../api/operations/options.js"; +import type { Operation } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a Operations operations. */ +export interface OperationsOperations { + /** List the operations for the provider */ + list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; +} + +function _getOperations(context: RedisManagementContext) { + return { + list: (options?: OperationsListOptionalParams) => list(context, options), + }; +} + +export function _getOperationsOperations(context: RedisManagementContext): OperationsOperations { + return { + ..._getOperations(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/patchSchedules/index.ts b/sdk/redis/arm-rediscache/src/classic/patchSchedules/index.ts new file mode 100644 index 000000000000..a91788b5f6b0 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/patchSchedules/index.ts @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { + listByRedisResource, + $delete, + createOrUpdate, + get, +} from "../../api/patchSchedules/operations.js"; +import type { + PatchSchedulesListByRedisResourceOptionalParams, + PatchSchedulesDeleteOptionalParams, + PatchSchedulesCreateOrUpdateOptionalParams, + PatchSchedulesGetOptionalParams, +} from "../../api/patchSchedules/options.js"; +import type { RedisPatchSchedule, DefaultName } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a PatchSchedules operations. */ +export interface PatchSchedulesOperations { + /** Gets all patch schedules in the specified redis cache (there is only one). */ + listByRedisResource: ( + resourceGroupName: string, + cacheName: string, + options?: PatchSchedulesListByRedisResourceOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the patching schedule of a redis cache. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options?: PatchSchedulesDeleteOptionalParams, + ) => Promise; + /** Create or replace the patching schedule for Redis cache. */ + createOrUpdate: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + parameters: RedisPatchSchedule, + options?: PatchSchedulesCreateOrUpdateOptionalParams, + ) => Promise; + /** Gets the patching schedule of a redis cache. */ + get: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options?: PatchSchedulesGetOptionalParams, + ) => Promise; +} + +function _getPatchSchedules(context: RedisManagementContext) { + return { + listByRedisResource: ( + resourceGroupName: string, + cacheName: string, + options?: PatchSchedulesListByRedisResourceOptionalParams, + ) => listByRedisResource(context, resourceGroupName, cacheName, options), + delete: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options?: PatchSchedulesDeleteOptionalParams, + ) => $delete(context, resourceGroupName, name, defaultParam, options), + createOrUpdate: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + parameters: RedisPatchSchedule, + options?: PatchSchedulesCreateOrUpdateOptionalParams, + ) => createOrUpdate(context, resourceGroupName, name, defaultParam, parameters, options), + get: ( + resourceGroupName: string, + name: string, + defaultParam: DefaultName, + options?: PatchSchedulesGetOptionalParams, + ) => get(context, resourceGroupName, name, defaultParam, options), + }; +} + +export function _getPatchSchedulesOperations( + context: RedisManagementContext, +): PatchSchedulesOperations { + return { + ..._getPatchSchedules(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/privateEndpointConnections/index.ts b/sdk/redis/arm-rediscache/src/classic/privateEndpointConnections/index.ts new file mode 100644 index 000000000000..2dbfc37ef5c2 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/privateEndpointConnections/index.ts @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { list, $delete, put, get } from "../../api/privateEndpointConnections/operations.js"; +import type { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "../../api/privateEndpointConnections/options.js"; +import type { PrivateEndpointConnection } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a PrivateEndpointConnections operations. */ +export interface PrivateEndpointConnectionsOperations { + /** List all the private endpoint connections associated with the redis cache. */ + list: ( + resourceGroupName: string, + cacheName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes the specified private endpoint connection associated with the redis cache. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => Promise; + /** Update the state of specified private endpoint connection associated with the redis cache. */ + put: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams, + ) => PollerLike, PrivateEndpointConnection>; + /** Gets the specified private endpoint connection associated with the redis cache. */ + get: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => Promise; +} + +function _getPrivateEndpointConnections(context: RedisManagementContext) { + return { + list: ( + resourceGroupName: string, + cacheName: string, + options?: PrivateEndpointConnectionsListOptionalParams, + ) => list(context, resourceGroupName, cacheName, options), + delete: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsDeleteOptionalParams, + ) => $delete(context, resourceGroupName, cacheName, privateEndpointConnectionName, options), + put: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + properties: PrivateEndpointConnection, + options?: PrivateEndpointConnectionsPutOptionalParams, + ) => + put( + context, + resourceGroupName, + cacheName, + privateEndpointConnectionName, + properties, + options, + ), + get: ( + resourceGroupName: string, + cacheName: string, + privateEndpointConnectionName: string, + options?: PrivateEndpointConnectionsGetOptionalParams, + ) => get(context, resourceGroupName, cacheName, privateEndpointConnectionName, options), + }; +} + +export function _getPrivateEndpointConnectionsOperations( + context: RedisManagementContext, +): PrivateEndpointConnectionsOperations { + return { + ..._getPrivateEndpointConnections(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/privateLinkResources/index.ts b/sdk/redis/arm-rediscache/src/classic/privateLinkResources/index.ts new file mode 100644 index 000000000000..fccb78f6c0d1 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/privateLinkResources/index.ts @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { listByRedisCache } from "../../api/privateLinkResources/operations.js"; +import type { PrivateLinkResourcesListByRedisCacheOptionalParams } from "../../api/privateLinkResources/options.js"; +import type { PrivateLinkResource } from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; + +/** Interface representing a PrivateLinkResources operations. */ +export interface PrivateLinkResourcesOperations { + /** Gets the private link resources that need to be created for a redis cache. */ + listByRedisCache: ( + resourceGroupName: string, + cacheName: string, + options?: PrivateLinkResourcesListByRedisCacheOptionalParams, + ) => PagedAsyncIterableIterator; +} + +function _getPrivateLinkResources(context: RedisManagementContext) { + return { + listByRedisCache: ( + resourceGroupName: string, + cacheName: string, + options?: PrivateLinkResourcesListByRedisCacheOptionalParams, + ) => listByRedisCache(context, resourceGroupName, cacheName, options), + }; +} + +export function _getPrivateLinkResourcesOperations( + context: RedisManagementContext, +): PrivateLinkResourcesOperations { + return { + ..._getPrivateLinkResources(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/classic/redis/index.ts b/sdk/redis/arm-rediscache/src/classic/redis/index.ts new file mode 100644 index 000000000000..954617740466 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/classic/redis/index.ts @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementContext } from "../../api/redisManagementContext.js"; +import { + checkNameAvailability, + flushCache, + exportData, + importData, + forceReboot, + regenerateKey, + listKeys, + listUpgradeNotifications, + listBySubscription, + listByResourceGroup, + $delete, + update, + create, + get, +} from "../../api/redis/operations.js"; +import type { + RedisCheckNameAvailabilityOptionalParams, + RedisFlushCacheOptionalParams, + RedisExportDataOptionalParams, + RedisImportDataOptionalParams, + RedisForceRebootOptionalParams, + RedisRegenerateKeyOptionalParams, + RedisListKeysOptionalParams, + RedisListUpgradeNotificationsOptionalParams, + RedisListBySubscriptionOptionalParams, + RedisListByResourceGroupOptionalParams, + RedisDeleteOptionalParams, + RedisUpdateOptionalParams, + RedisCreateOptionalParams, + RedisGetOptionalParams, +} from "../../api/redis/options.js"; +import type { + RedisResource, + RedisAccessKeys, + RedisCreateParameters, + RedisUpdateParameters, + UpgradeNotification, + RedisRegenerateKeyParameters, + RedisRebootParameters, + RedisForceRebootResponse, + ImportRDBParameters, + ExportRDBParameters, + OperationStatusResult, + CheckNameAvailabilityParameters, +} from "../../models/models.js"; +import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; +import type { PollerLike, OperationState } from "@azure/core-lro"; + +/** Interface representing a Redis operations. */ +export interface RedisOperations { + /** Checks that the redis cache name is valid and is not already in use. */ + checkNameAvailability: ( + parameters: CheckNameAvailabilityParameters, + options?: RedisCheckNameAvailabilityOptionalParams, + ) => Promise; + /** Deletes all of the keys in a cache. */ + flushCache: ( + resourceGroupName: string, + cacheName: string, + options?: RedisFlushCacheOptionalParams, + ) => PollerLike, OperationStatusResult>; + /** Export data from the redis cache to blobs in a container. */ + exportData: ( + resourceGroupName: string, + name: string, + parameters: ExportRDBParameters, + options?: RedisExportDataOptionalParams, + ) => PollerLike, void>; + /** Import data into Redis cache. */ + importData: ( + resourceGroupName: string, + name: string, + parameters: ImportRDBParameters, + options?: RedisImportDataOptionalParams, + ) => PollerLike, void>; + /** Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss. */ + forceReboot: ( + resourceGroupName: string, + name: string, + parameters: RedisRebootParameters, + options?: RedisForceRebootOptionalParams, + ) => Promise; + /** Regenerate Redis cache's access keys. This operation requires write permission to the cache resource. */ + regenerateKey: ( + resourceGroupName: string, + name: string, + parameters: RedisRegenerateKeyParameters, + options?: RedisRegenerateKeyOptionalParams, + ) => Promise; + /** Retrieve a Redis cache's access keys. This operation requires write permission to the cache resource. */ + listKeys: ( + resourceGroupName: string, + name: string, + options?: RedisListKeysOptionalParams, + ) => Promise; + /** [Deprecated] Gets any upgrade notifications for a Redis cache. */ + listUpgradeNotifications: ( + resourceGroupName: string, + name: string, + history: number, + options?: RedisListUpgradeNotificationsOptionalParams, + ) => PagedAsyncIterableIterator; + /** Gets all Redis caches in the specified subscription. */ + listBySubscription: ( + options?: RedisListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** Lists all Redis caches in a resource group. */ + listByResourceGroup: ( + resourceGroupName: string, + options?: RedisListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Deletes a Redis cache. */ + /** + * @fixme delete is a reserved word that cannot be used as an operation name. + * Please add @clientName("clientName") or @clientName("", "javascript") + * to the operation to override the generated name. + */ + delete: ( + resourceGroupName: string, + name: string, + options?: RedisDeleteOptionalParams, + ) => PollerLike, void>; + /** Update an existing Redis cache. */ + update: ( + resourceGroupName: string, + name: string, + parameters: RedisUpdateParameters, + options?: RedisUpdateOptionalParams, + ) => PollerLike, RedisResource>; + /** Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. */ + create: ( + resourceGroupName: string, + name: string, + parameters: RedisCreateParameters, + options?: RedisCreateOptionalParams, + ) => PollerLike, RedisResource>; + /** Gets a Redis cache (resource description). */ + get: ( + resourceGroupName: string, + name: string, + options?: RedisGetOptionalParams, + ) => Promise; +} + +function _getRedis(context: RedisManagementContext) { + return { + checkNameAvailability: ( + parameters: CheckNameAvailabilityParameters, + options?: RedisCheckNameAvailabilityOptionalParams, + ) => checkNameAvailability(context, parameters, options), + flushCache: ( + resourceGroupName: string, + cacheName: string, + options?: RedisFlushCacheOptionalParams, + ) => flushCache(context, resourceGroupName, cacheName, options), + exportData: ( + resourceGroupName: string, + name: string, + parameters: ExportRDBParameters, + options?: RedisExportDataOptionalParams, + ) => exportData(context, resourceGroupName, name, parameters, options), + importData: ( + resourceGroupName: string, + name: string, + parameters: ImportRDBParameters, + options?: RedisImportDataOptionalParams, + ) => importData(context, resourceGroupName, name, parameters, options), + forceReboot: ( + resourceGroupName: string, + name: string, + parameters: RedisRebootParameters, + options?: RedisForceRebootOptionalParams, + ) => forceReboot(context, resourceGroupName, name, parameters, options), + regenerateKey: ( + resourceGroupName: string, + name: string, + parameters: RedisRegenerateKeyParameters, + options?: RedisRegenerateKeyOptionalParams, + ) => regenerateKey(context, resourceGroupName, name, parameters, options), + listKeys: (resourceGroupName: string, name: string, options?: RedisListKeysOptionalParams) => + listKeys(context, resourceGroupName, name, options), + listUpgradeNotifications: ( + resourceGroupName: string, + name: string, + history: number, + options?: RedisListUpgradeNotificationsOptionalParams, + ) => listUpgradeNotifications(context, resourceGroupName, name, history, options), + listBySubscription: (options?: RedisListBySubscriptionOptionalParams) => + listBySubscription(context, options), + listByResourceGroup: ( + resourceGroupName: string, + options?: RedisListByResourceGroupOptionalParams, + ) => listByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, name: string, options?: RedisDeleteOptionalParams) => + $delete(context, resourceGroupName, name, options), + update: ( + resourceGroupName: string, + name: string, + parameters: RedisUpdateParameters, + options?: RedisUpdateOptionalParams, + ) => update(context, resourceGroupName, name, parameters, options), + create: ( + resourceGroupName: string, + name: string, + parameters: RedisCreateParameters, + options?: RedisCreateOptionalParams, + ) => create(context, resourceGroupName, name, parameters, options), + get: (resourceGroupName: string, name: string, options?: RedisGetOptionalParams) => + get(context, resourceGroupName, name, options), + }; +} + +export function _getRedisOperations(context: RedisManagementContext): RedisOperations { + return { + ..._getRedis(context), + }; +} diff --git a/sdk/redis/arm-rediscache/src/index.ts b/sdk/redis/arm-rediscache/src/index.ts index 3a067cfdf5fc..27970dd0d3c3 100644 --- a/sdk/redis/arm-rediscache/src/index.ts +++ b/sdk/redis/arm-rediscache/src/index.ts @@ -1,13 +1,171 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { AzureClouds, AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js"; +import { + PageSettings, + ContinuablePage, + PagedAsyncIterableIterator, +} from "./static-helpers/pagingHelpers.js"; -/// -export { getContinuationToken } from "./pagingHelper.js"; -export * from "./models/index.js"; export { RedisManagementClient } from "./redisManagementClient.js"; -export * from "./operationsInterfaces/index.js"; +export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; +export { + Operation, + OperationDisplay, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + RedisLinkedServerWithProperties, + RedisLinkedServerProperties, + RedisLinkedServerCreateProperties, + ReplicationRole, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + RedisLinkedServerCreateParameters, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + PrivateEndpointConnectionProvisioningState, + RedisResource, + RedisProperties, + KnownProvisioningState, + ProvisioningState, + RedisAccessKeys, + RedisLinkedServer, + RedisInstanceDetails, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + RedisCreateProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuFamily, + SkuFamily, + RedisCommonProperties, + RedisCommonPropertiesRedisConfiguration, + KnownTlsVersion, + TlsVersion, + KnownPublicNetworkAccess, + PublicNetworkAccess, + KnownUpdateChannel, + UpdateChannel, + KnownZonalAllocationPolicy, + ZonalAllocationPolicy, + TrackedResource, + RedisCreateParameters, + RedisUpdateParameters, + RedisUpdateProperties, + UpgradeNotification, + RedisRegenerateKeyParameters, + RedisKeyType, + RedisRebootParameters, + KnownRebootType, + RebootType, + RedisForceRebootResponse, + ImportRDBParameters, + ExportRDBParameters, + OperationStatusResult, + CheckNameAvailabilityParameters, + PrivateLinkResource, + PrivateLinkResourceProperties, + RedisFirewallRule, + RedisFirewallRuleProperties, + RedisPatchSchedule, + ScheduleEntries, + ScheduleEntry, + DayOfWeek, + KnownDefaultName, + DefaultName, + RedisCacheAccessPolicy, + RedisCacheAccessPolicyProperties, + KnownAccessPolicyProvisioningState, + AccessPolicyProvisioningState, + KnownAccessPolicyType, + AccessPolicyType, + RedisCacheAccessPolicyAssignment, + RedisCacheAccessPolicyAssignmentProperties, + KnownAccessPolicyAssignmentProvisioningState, + AccessPolicyAssignmentProvisioningState, + OperationStatus, + KnownVersions, +} from "./models/index.js"; +export { RedisManagementClientOptionalParams } from "./api/index.js"; +export { + AccessPolicyListOptionalParams, + AccessPolicyDeleteOptionalParams, + AccessPolicyCreateUpdateOptionalParams, + AccessPolicyGetOptionalParams, +} from "./api/accessPolicy/index.js"; +export { + AccessPolicyAssignmentListOptionalParams, + AccessPolicyAssignmentDeleteOptionalParams, + AccessPolicyAssignmentCreateUpdateOptionalParams, + AccessPolicyAssignmentGetOptionalParams, +} from "./api/accessPolicyAssignment/index.js"; +export { AsyncOperationStatusGetOptionalParams } from "./api/asyncOperationStatus/index.js"; +export { + FirewallRulesListOptionalParams, + FirewallRulesDeleteOptionalParams, + FirewallRulesCreateOrUpdateOptionalParams, + FirewallRulesGetOptionalParams, +} from "./api/firewallRules/index.js"; +export { + LinkedServerListOptionalParams, + LinkedServerDeleteOptionalParams, + LinkedServerCreateOptionalParams, + LinkedServerGetOptionalParams, +} from "./api/linkedServer/index.js"; +export { OperationsListOptionalParams } from "./api/operations/index.js"; +export { + PatchSchedulesListByRedisResourceOptionalParams, + PatchSchedulesDeleteOptionalParams, + PatchSchedulesCreateOrUpdateOptionalParams, + PatchSchedulesGetOptionalParams, +} from "./api/patchSchedules/index.js"; +export { + PrivateEndpointConnectionsListOptionalParams, + PrivateEndpointConnectionsDeleteOptionalParams, + PrivateEndpointConnectionsPutOptionalParams, + PrivateEndpointConnectionsGetOptionalParams, +} from "./api/privateEndpointConnections/index.js"; +export { PrivateLinkResourcesListByRedisCacheOptionalParams } from "./api/privateLinkResources/index.js"; +export { + RedisCheckNameAvailabilityOptionalParams, + RedisFlushCacheOptionalParams, + RedisExportDataOptionalParams, + RedisImportDataOptionalParams, + RedisForceRebootOptionalParams, + RedisRegenerateKeyOptionalParams, + RedisListKeysOptionalParams, + RedisListUpgradeNotificationsOptionalParams, + RedisListBySubscriptionOptionalParams, + RedisListByResourceGroupOptionalParams, + RedisDeleteOptionalParams, + RedisUpdateOptionalParams, + RedisCreateOptionalParams, + RedisGetOptionalParams, +} from "./api/redis/index.js"; +export { + AccessPolicyOperations, + AccessPolicyAssignmentOperations, + AsyncOperationStatusOperations, + FirewallRulesOperations, + LinkedServerOperations, + OperationsOperations, + PatchSchedulesOperations, + PrivateEndpointConnectionsOperations, + PrivateLinkResourcesOperations, + RedisOperations, +} from "./classic/index.js"; +export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; +export { AzureClouds, AzureSupportedClouds }; diff --git a/sdk/redis/arm-rediscache/src/logger.ts b/sdk/redis/arm-rediscache/src/logger.ts new file mode 100644 index 000000000000..b59acb89a843 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/logger.ts @@ -0,0 +1,5 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { createClientLogger } from "@azure/logger"; +export const logger = createClientLogger("arm-rediscache"); diff --git a/sdk/redis/arm-rediscache/src/lroImpl.ts b/sdk/redis/arm-rediscache/src/lroImpl.ts deleted file mode 100644 index d8bc98987053..000000000000 --- a/sdk/redis/arm-rediscache/src/lroImpl.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ -import { AbortSignalLike } from "@azure/abort-controller"; -import { LongRunningOperation, LroResponse } from "@azure/core-lro"; - -export function createLroSpec(inputs: { - sendOperationFn: (args: any, spec: any) => Promise>; - args: Record; - spec: { - readonly requestBody?: unknown; - readonly path?: string; - readonly httpMethod: string; - } & Record; -}): LongRunningOperation { - const { args, spec, sendOperationFn } = inputs; - return { - requestMethod: spec.httpMethod, - requestPath: spec.path!, - sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: ( - path: string, - options?: { abortSignal?: AbortSignalLike }, - ) => { - const { requestBody, ...restSpec } = spec; - return sendOperationFn(args, { - ...restSpec, - httpMethod: "GET", - path, - abortSignal: options?.abortSignal, - }); - }, - }; -} diff --git a/sdk/redis/arm-rediscache/src/models/index.ts b/sdk/redis/arm-rediscache/src/models/index.ts index 1f1c0d5dc5eb..b702b11784a9 100644 --- a/sdk/redis/arm-rediscache/src/models/index.ts +++ b/sdk/redis/arm-rediscache/src/models/index.ts @@ -1,1683 +1,92 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -/** Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. */ -export interface OperationListResult { - /** List of operations supported by the resource provider. */ - value?: Operation[]; - /** - * URL to get the next set of operation list results if there are any. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** REST API operation */ -export interface Operation { - /** Operation name: {provider}/{resource}/{operation} */ - name?: string; - /** The object that describes the operation. */ - display?: OperationDisplay; -} - -/** The object that describes the operation. */ -export interface OperationDisplay { - /** Friendly name of the resource provider */ - provider?: string; - /** Operation type: read, write, delete, listKeys/action, etc. */ - operation?: string; - /** Resource type on which the operation is performed. */ - resource?: string; - /** Friendly name of the operation */ - description?: string; -} - -/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). */ -export interface ErrorResponse { - /** The error object. */ - error?: ErrorDetail; -} - -/** The error detail. */ -export interface ErrorDetail { - /** - * The error code. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly code?: string; - /** - * The error message. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; - /** - * The error target. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly target?: string; - /** - * The error details. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly details?: ErrorDetail[]; - /** - * The error additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** - * The additional info type. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; - /** - * The additional info. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly info?: Record; -} - -/** Parameters body to pass for resource name availability check. */ -export interface CheckNameAvailabilityParameters { - /** Resource name. */ - name: string; - /** Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'. */ - type: string; -} - -/** The response of listUpgradeNotifications. */ -export interface NotificationListResponse { - /** List of all notifications. */ - value?: UpgradeNotification[]; - /** - * Link for next set of notifications. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Properties of upgrade notification. */ -export interface UpgradeNotification { - /** - * Name of upgrade notification. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * Timestamp when upgrade notification occurred. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly timestamp?: Date; - /** - * Details about this upgrade notification - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly upsellNotification?: { [propertyName: string]: string }; -} - -/** Parameters supplied to the Create Redis operation. */ -export interface RedisCreateParameters { - /** A list of availability zones denoting where the resource needs to come from. */ - zones?: string[]; - /** The geo-location where the resource lives */ - location: string; - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The identity of the resource. */ - identity?: ManagedServiceIdentity; - /** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - /** Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. */ - redisVersion?: string; - /** Specifies whether the non-ssl Redis server port (6379) is enabled. */ - enableNonSslPort?: boolean; - /** The number of replicas to be created per primary. */ - replicasPerMaster?: number; - /** The number of replicas to be created per primary. */ - replicasPerPrimary?: number; - /** A dictionary of tenant settings */ - tenantSettings?: { [propertyName: string]: string }; - /** The number of shards to be created on a Premium Cluster Cache. */ - shardCount?: number; - /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ - minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ - publicNetworkAccess?: PublicNetworkAccess; - /** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ - updateChannel?: UpdateChannel; - /** Authentication to Redis through access keys is disabled when set as true. Default value is false. */ - disableAccessKeyAuthentication?: boolean; - /** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ - zonalAllocationPolicy?: ZonalAllocationPolicy; - /** The SKU of the Redis cache to deploy. */ - sku: Sku; - /** The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 */ - subnetId?: string; - /** Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. */ - staticIP?: string; -} - -/** SKU parameters supplied to the create Redis operation. */ -export interface Sku { - /** The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium) */ - name: SkuName; - /** The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). */ - family: SkuFamily; - /** The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). */ - capacity: number; -} - -/** Create/Update/Get common properties of the redis cache. */ -export interface RedisCommonProperties { - /** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - /** Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. */ - redisVersion?: string; - /** Specifies whether the non-ssl Redis server port (6379) is enabled. */ - enableNonSslPort?: boolean; - /** The number of replicas to be created per primary. */ - replicasPerMaster?: number; - /** The number of replicas to be created per primary. */ - replicasPerPrimary?: number; - /** A dictionary of tenant settings */ - tenantSettings?: { [propertyName: string]: string }; - /** The number of shards to be created on a Premium Cluster Cache. */ - shardCount?: number; - /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ - minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ - publicNetworkAccess?: PublicNetworkAccess; - /** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ - updateChannel?: UpdateChannel; - /** Authentication to Redis through access keys is disabled when set as true. Default value is false. */ - disableAccessKeyAuthentication?: boolean; - /** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ - zonalAllocationPolicy?: ZonalAllocationPolicy; -} - -/** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ -export interface RedisCommonPropertiesRedisConfiguration { - /** Describes unknown properties. The value of an unknown property can be of "any" type. */ - [property: string]: any; - /** Specifies whether the rdb backup is enabled */ - rdbBackupEnabled?: string; - /** Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440) */ - rdbBackupFrequency?: string; - /** Specifies the maximum number of snapshots for rdb backup */ - rdbBackupMaxSnapshotCount?: string; - /** The storage account connection string for storing rdb file */ - rdbStorageConnectionString?: string; - /** Specifies whether the aof backup is enabled */ - aofBackupEnabled?: string; - /** First storage account connection string */ - aofStorageConnectionString0?: string; - /** Second storage account connection string */ - aofStorageConnectionString1?: string; - /** Value in megabytes reserved for fragmentation per shard */ - maxfragmentationmemoryReserved?: string; - /** The eviction strategy used when your data won't fit within its memory limit. */ - maxmemoryPolicy?: string; - /** Value in megabytes reserved for non-cache usage per shard e.g. failover. */ - maxmemoryReserved?: string; - /** Value in megabytes reserved for non-cache usage per shard e.g. failover. */ - maxmemoryDelta?: string; - /** - * The max clients config - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly maxclients?: string; - /** The keyspace events which should be monitored. */ - notifyKeyspaceEvents?: string; - /** - * Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly preferredDataArchiveAuthMethod?: string; - /** Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS */ - preferredDataPersistenceAuthMethod?: string; - /** - * Zonal Configuration - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zonalConfiguration?: string; - /** Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view. */ - authnotrequired?: string; - /** SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity. */ - storageSubscriptionId?: string; - /** Specifies whether AAD based authentication has been enabled or disabled for the cache */ - aadEnabled?: string; -} - -/** Managed service identity (system assigned and/or user assigned identities) */ -export interface ManagedServiceIdentity { - /** - * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly tenantId?: string; - /** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - type: ManagedServiceIdentityType; - /** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ - userAssignedIdentities?: { [propertyName: string]: UserAssignedIdentity }; -} - -/** User assigned identity properties */ -export interface UserAssignedIdentity { - /** - * The principal ID of the assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly principalId?: string; - /** - * The client ID of the assigned identity. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly clientId?: string; -} - -/** Redis cache access keys. */ -export interface RedisAccessKeys { - /** - * The current primary key that clients can use to authenticate with Redis cache. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly primaryKey?: string; - /** - * The current secondary key that clients can use to authenticate with Redis cache. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly secondaryKey?: string; -} - -/** Linked server Id */ -export interface RedisLinkedServer { - /** - * Linked server Id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** Details of single instance of redis. */ -export interface RedisInstanceDetails { - /** - * Redis instance SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sslPort?: number; - /** - * If enableNonSslPort is true, provides Redis instance Non-SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nonSslPort?: number; - /** - * If the Cache uses availability zones, specifies availability zone where this instance is located. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly zone?: string; - /** - * If clustering is enabled, the Shard ID of Redis Instance - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly shardId?: number; - /** - * Specifies whether the instance is a primary node. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isMaster?: boolean; - /** - * Specifies whether the instance is a primary node. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly isPrimary?: boolean; -} - -/** The Private Endpoint resource. */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - -/** Common fields that are returned in the response for all Azure Resource Manager resources */ -export interface Resource { - /** - * Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; - /** - * The name of the resource - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly name?: string; - /** - * The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly type?: string; -} - -/** Parameters supplied to the Update Redis operation. */ -export interface RedisUpdateParameters { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The identity of the resource. */ - identity?: ManagedServiceIdentity; - /** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - /** Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. */ - redisVersion?: string; - /** Specifies whether the non-ssl Redis server port (6379) is enabled. */ - enableNonSslPort?: boolean; - /** The number of replicas to be created per primary. */ - replicasPerMaster?: number; - /** The number of replicas to be created per primary. */ - replicasPerPrimary?: number; - /** A dictionary of tenant settings */ - tenantSettings?: { [propertyName: string]: string }; - /** The number of shards to be created on a Premium Cluster Cache. */ - shardCount?: number; - /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ - minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ - publicNetworkAccess?: PublicNetworkAccess; - /** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ - updateChannel?: UpdateChannel; - /** Authentication to Redis through access keys is disabled when set as true. Default value is false. */ - disableAccessKeyAuthentication?: boolean; - /** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ - zonalAllocationPolicy?: ZonalAllocationPolicy; - /** The SKU of the Redis cache to deploy. */ - sku?: Sku; -} - -/** The response of list Redis operation. */ -export interface RedisListResult { - /** List of Redis cache instances. */ - value?: RedisResource[]; - /** - * Link for next page of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Specifies which Redis access keys to reset. */ -export interface RedisRegenerateKeyParameters { - /** The Redis access key to regenerate. */ - keyType: RedisKeyType; -} - -/** Specifies which Redis node(s) to reboot. */ -export interface RedisRebootParameters { - /** Which Redis node(s) to reboot. Depending on this value data loss is possible. */ - rebootType?: RebootType; - /** If clustering is enabled, the ID of the shard to be rebooted. */ - shardId?: number; - /** A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL ports. */ - ports?: number[]; -} - -/** Response to force reboot for Redis cache. */ -export interface RedisForceRebootResponse { - /** - * Status message - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly message?: string; -} - -/** Parameters for Redis import operation. */ -export interface ImportRDBParameters { - /** File format. */ - format?: string; - /** files to import. */ - files: string[]; - /** Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS */ - preferredDataArchiveAuthMethod?: string; - /** Subscription id of the storage container containing files to import using Managed Identity. */ - storageSubscriptionId?: string; -} - -/** Parameters for Redis export operation. */ -export interface ExportRDBParameters { - /** File format. */ - format?: string; - /** Prefix to use for exported files. */ - prefix: string; - /** Container name to export to. */ - container: string; - /** Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS */ - preferredDataArchiveAuthMethod?: string; - /** Subscription id of the storage container for data to be exported using ManagedIdentity. */ - storageSubscriptionId?: string; -} - -/** The current status of an async operation. */ -export interface OperationStatusResult { - /** Fully qualified ID for the async operation. */ - id?: string; - /** Name of the async operation. */ - name?: string; - /** Operation status. */ - status: string; - /** Percent of the operation that is complete. */ - percentComplete?: number; - /** The start time of the operation. */ - startTime?: Date; - /** The end time of the operation. */ - endTime?: Date; - /** The operations list. */ - operations?: OperationStatusResult[]; - /** If present, details of the operation error. */ - error?: ErrorDetail; -} - -/** The response of list firewall rules Redis operation. */ -export interface RedisFirewallRuleListResult { - /** Results of the list firewall rules operation. */ - value?: RedisFirewallRule[]; - /** - * Link for next page of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** The response of list patch schedules Redis operation. */ -export interface RedisPatchScheduleListResult { - /** Results of the list patch schedules operation. */ - value?: RedisPatchSchedule[]; - /** - * Link for next page of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Patch schedule entry for a Premium Redis Cache. */ -export interface ScheduleEntry { - /** Day of the week when a cache can be patched. */ - dayOfWeek: DayOfWeek; - /** Start hour after which cache patching can start. */ - startHourUtc: number; - /** ISO8601 timespan specifying how much time cache patching can take. */ - maintenanceWindow?: string; -} - -/** Parameter required for creating a linked server to redis cache. */ -export interface RedisLinkedServerCreateParameters { - /** Fully qualified resourceId of the linked redis cache. */ - linkedRedisCacheId: string; - /** Location of the linked redis cache. */ - linkedRedisCacheLocation: string; - /** Role of the linked server. */ - serverRole: ReplicationRole; - /** - * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly geoReplicatedPrimaryHostName?: string; - /** - * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly primaryHostName?: string; -} - -/** Create properties for a linked server */ -export interface RedisLinkedServerCreateProperties { - /** Fully qualified resourceId of the linked redis cache. */ - linkedRedisCacheId: string; - /** Location of the linked redis cache. */ - linkedRedisCacheLocation: string; - /** Role of the linked server. */ - serverRole: ReplicationRole; - /** - * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly geoReplicatedPrimaryHostName?: string; - /** - * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly primaryHostName?: string; -} - -/** List of linked servers (with properties) of a Redis cache. */ -export interface RedisLinkedServerWithPropertiesList { - /** List of linked servers (with properties) of a Redis cache. */ - value?: RedisLinkedServerWithProperties[]; - /** - * Link for next set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** List of private endpoint connection associated with the specified storage account */ -export interface PrivateEndpointConnectionListResult { - /** Array of private endpoint connections */ - value?: PrivateEndpointConnection[]; -} - -/** A list of private link resources */ -export interface PrivateLinkResourceListResult { - /** Array of private link resources */ - value?: PrivateLinkResource[]; -} - -/** List of access policies (with properties) of a Redis cache. */ -export interface RedisCacheAccessPolicyList { - /** List of access policies (with properties) of a Redis cache. */ - value?: RedisCacheAccessPolicy[]; - /** - * Link for next set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** List of access policies assignments (with properties) of a Redis cache. */ -export interface RedisCacheAccessPolicyAssignmentList { - /** List of access policies assignments (with properties) of a Redis cache. */ - value?: RedisCacheAccessPolicyAssignment[]; - /** - * Link for next set. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - -/** Properties supplied to Create Redis operation. */ -export interface RedisCreateProperties extends RedisCommonProperties { - /** The SKU of the Redis cache to deploy. */ - sku: Sku; - /** The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 */ - subnetId?: string; - /** Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. */ - staticIP?: string; -} - -/** Patchable properties of the redis cache. */ -export interface RedisUpdateProperties extends RedisCommonProperties { - /** The SKU of the Redis cache to deploy. */ - sku?: Sku; -} - -/** The Private Endpoint Connection resource. */ -export interface PrivateEndpointConnection extends Resource { - /** The resource of private end point. */ - privateEndpoint?: PrivateEndpoint; - /** A collection of information about the state of the connection between service consumer and provider. */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; -} - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: { [propertyName: string]: string }; - /** The geo-location where the resource lives */ - location: string; -} - -/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ -export interface ProxyResource extends Resource {} - -/** A private link resource */ -export interface PrivateLinkResource extends Resource { - /** - * The private link resource group id. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly groupId?: string; - /** - * The private link resource required member names. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly requiredMembers?: string[]; - /** The private link resource Private link DNS zone name. */ - requiredZoneNames?: string[]; -} - -/** Asynchronous operation status */ -export interface OperationStatus extends OperationStatusResult { - /** Additional properties from RP, only when operation is successful */ - properties?: { [propertyName: string]: any }; -} - -/** Properties of a linked server to be returned in get/put response */ -export interface RedisLinkedServerProperties - extends RedisLinkedServerCreateProperties { - /** - * Terminal state of the link between primary and secondary redis cache. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; -} - -/** Properties of the redis cache. */ -export interface RedisProperties extends RedisCreateProperties { - /** - * Redis instance provisioning status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * Redis host name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hostName?: string; - /** - * Redis non-SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly port?: number; - /** - * Redis SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sslPort?: number; - /** - * The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accessKeys?: RedisAccessKeys; - /** - * List of the linked servers associated with the cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly linkedServers?: RedisLinkedServer[]; - /** - * List of the Redis instances associated with the cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instances?: RedisInstanceDetails[]; - /** - * List of private endpoint connection associated with the specified redis cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; -} - -/** A single Redis item in List or Get Operation. */ -export interface RedisResource extends TrackedResource { - /** A list of availability zones denoting where the resource needs to come from. */ - zones?: string[]; - /** The identity of the resource. */ - identity?: ManagedServiceIdentity; - /** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ - redisConfiguration?: RedisCommonPropertiesRedisConfiguration; - /** Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. */ - redisVersion?: string; - /** Specifies whether the non-ssl Redis server port (6379) is enabled. */ - enableNonSslPort?: boolean; - /** The number of replicas to be created per primary. */ - replicasPerMaster?: number; - /** The number of replicas to be created per primary. */ - replicasPerPrimary?: number; - /** A dictionary of tenant settings */ - tenantSettings?: { [propertyName: string]: string }; - /** The number of shards to be created on a Premium Cluster Cache. */ - shardCount?: number; - /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ - minimumTlsVersion?: TlsVersion; - /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ - publicNetworkAccess?: PublicNetworkAccess; - /** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ - updateChannel?: UpdateChannel; - /** Authentication to Redis through access keys is disabled when set as true. Default value is false. */ - disableAccessKeyAuthentication?: boolean; - /** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ - zonalAllocationPolicy?: ZonalAllocationPolicy; - /** The SKU of the Redis cache to deploy. */ - sku: Sku; - /** The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 */ - subnetId?: string; - /** Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. */ - staticIP?: string; - /** - * Redis instance provisioning status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: ProvisioningState; - /** - * Redis host name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly hostName?: string; - /** - * Redis non-SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly port?: number; - /** - * Redis SSL port. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly sslPort?: number; - /** - * The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly accessKeys?: RedisAccessKeys; - /** - * List of the linked servers associated with the cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly linkedServers?: RedisLinkedServer[]; - /** - * List of the Redis instances associated with the cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly instances?: RedisInstanceDetails[]; - /** - * List of private endpoint connection associated with the specified redis cache - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly privateEndpointConnections?: PrivateEndpointConnection[]; -} - -/** A firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted to connect */ -export interface RedisFirewallRule extends ProxyResource { - /** lowest IP address included in the range */ - startIP: string; - /** highest IP address included in the range */ - endIP: string; -} - -/** Response to put/get patch schedules for Redis cache. */ -export interface RedisPatchSchedule extends ProxyResource { - /** - * The geo-location where the resource lives - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly location?: string; - /** List of patch schedules for a Redis cache. */ - scheduleEntries: ScheduleEntry[]; -} - -/** Response to put/get linked server (with properties) for Redis cache. */ -export interface RedisLinkedServerWithProperties extends ProxyResource { - /** Fully qualified resourceId of the linked redis cache. */ - linkedRedisCacheId?: string; - /** Location of the linked redis cache. */ - linkedRedisCacheLocation?: string; - /** Role of the linked server. */ - serverRole?: ReplicationRole; - /** - * The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly geoReplicatedPrimaryHostName?: string; - /** - * The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly primaryHostName?: string; - /** - * Terminal state of the link between primary and secondary redis cache. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: string; -} - -/** Response to get/put access policy. */ -export interface RedisCacheAccessPolicy extends ProxyResource { - /** - * Provisioning state of access policy - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: AccessPolicyProvisioningState; - /** - * Built-In or Custom access policy - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly typePropertiesType?: AccessPolicyType; - /** Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites */ - permissions?: string; -} - -/** Response to an operation on access policy assignment */ -export interface RedisCacheAccessPolicyAssignment extends ProxyResource { - /** - * Provisioning state of an access policy assignment set - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: AccessPolicyAssignmentProvisioningState; - /** Object Id to assign access policy to */ - objectId?: string; - /** User friendly name for object id. Also represents username for token based authentication */ - objectIdAlias?: string; - /** The name of the access policy that is being assigned */ - accessPolicyName?: string; -} - -/** Parameters required for creating a firewall rule on redis cache. (Note, you can just use the FirewallRule type instead now.) */ -export interface RedisFirewallRuleCreateParameters extends RedisFirewallRule {} - -/** Defines headers for Redis_flushCache operation. */ -export interface RedisFlushCacheHeaders { - /** URL to query for the status of the operation. */ - location?: string; - /** URL to query for the status of the operation. */ - azureAsyncOperation?: string; -} - -/** Defines headers for LinkedServer_delete operation. */ -export interface LinkedServerDeleteHeaders { - location?: string; -} - -/** Defines headers for AccessPolicy_delete operation. */ -export interface AccessPolicyDeleteHeaders { - location?: string; -} - -/** Defines headers for AccessPolicyAssignment_delete operation. */ -export interface AccessPolicyAssignmentDeleteHeaders { - location?: string; -} - -/** Known values of {@link SkuName} that the service accepts. */ -export enum KnownSkuName { - /** Basic */ - Basic = "Basic", - /** Standard */ - Standard = "Standard", - /** Premium */ - Premium = "Premium", -} - -/** - * Defines values for SkuName. \ - * {@link KnownSkuName} can be used interchangeably with SkuName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Basic** \ - * **Standard** \ - * **Premium** - */ -export type SkuName = string; - -/** Known values of {@link SkuFamily} that the service accepts. */ -export enum KnownSkuFamily { - /** C */ - C = "C", - /** P */ - P = "P", -} - -/** - * Defines values for SkuFamily. \ - * {@link KnownSkuFamily} can be used interchangeably with SkuFamily, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **C** \ - * **P** - */ -export type SkuFamily = string; - -/** Known values of {@link TlsVersion} that the service accepts. */ -export enum KnownTlsVersion { - /** One0 */ - One0 = "1.0", - /** One1 */ - One1 = "1.1", - /** One2 */ - One2 = "1.2", -} - -/** - * Defines values for TlsVersion. \ - * {@link KnownTlsVersion} can be used interchangeably with TlsVersion, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **1.0** \ - * **1.1** \ - * **1.2** - */ -export type TlsVersion = string; - -/** Known values of {@link PublicNetworkAccess} that the service accepts. */ -export enum KnownPublicNetworkAccess { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", -} - -/** - * Defines values for PublicNetworkAccess. \ - * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** - */ -export type PublicNetworkAccess = string; - -/** Known values of {@link UpdateChannel} that the service accepts. */ -export enum KnownUpdateChannel { - /** Stable */ - Stable = "Stable", - /** Preview */ - Preview = "Preview", -} - -/** - * Defines values for UpdateChannel. \ - * {@link KnownUpdateChannel} can be used interchangeably with UpdateChannel, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Stable** \ - * **Preview** - */ -export type UpdateChannel = string; - -/** Known values of {@link ZonalAllocationPolicy} that the service accepts. */ -export enum KnownZonalAllocationPolicy { - /** Automatic */ - Automatic = "Automatic", - /** UserDefined */ - UserDefined = "UserDefined", - /** NoZones */ - NoZones = "NoZones", -} - -/** - * Defines values for ZonalAllocationPolicy. \ - * {@link KnownZonalAllocationPolicy} can be used interchangeably with ZonalAllocationPolicy, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Automatic** \ - * **UserDefined** \ - * **NoZones** - */ -export type ZonalAllocationPolicy = string; - -/** Known values of {@link ManagedServiceIdentityType} that the service accepts. */ -export enum KnownManagedServiceIdentityType { - /** None */ - None = "None", - /** SystemAssigned */ - SystemAssigned = "SystemAssigned", - /** UserAssigned */ - UserAssigned = "UserAssigned", - /** SystemAssignedUserAssigned */ - SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", -} - -/** - * Defines values for ManagedServiceIdentityType. \ - * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None** \ - * **SystemAssigned** \ - * **UserAssigned** \ - * **SystemAssigned, UserAssigned** - */ -export type ManagedServiceIdentityType = string; - -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Disabled */ - Disabled = "Disabled", - /** Failed */ - Failed = "Failed", - /** Linking */ - Linking = "Linking", - /** Provisioning */ - Provisioning = "Provisioning", - /** RecoveringScaleFailure */ - RecoveringScaleFailure = "RecoveringScaleFailure", - /** Scaling */ - Scaling = "Scaling", - /** Succeeded */ - Succeeded = "Succeeded", - /** Unlinking */ - Unlinking = "Unlinking", - /** Unprovisioning */ - Unprovisioning = "Unprovisioning", - /** Updating */ - Updating = "Updating", - /** ConfiguringAAD */ - ConfiguringAAD = "ConfiguringAAD", -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Creating** \ - * **Deleting** \ - * **Disabled** \ - * **Failed** \ - * **Linking** \ - * **Provisioning** \ - * **RecoveringScaleFailure** \ - * **Scaling** \ - * **Succeeded** \ - * **Unlinking** \ - * **Unprovisioning** \ - * **Updating** \ - * **ConfiguringAAD** - */ -export type ProvisioningState = string; - -/** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ -export enum KnownPrivateEndpointServiceConnectionStatus { - /** Pending */ - Pending = "Pending", - /** Approved */ - Approved = "Approved", - /** Rejected */ - Rejected = "Rejected", -} - -/** - * Defines values for PrivateEndpointServiceConnectionStatus. \ - * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Pending** \ - * **Approved** \ - * **Rejected** - */ -export type PrivateEndpointServiceConnectionStatus = string; - -/** Known values of {@link PrivateEndpointConnectionProvisioningState} that the service accepts. */ -export enum KnownPrivateEndpointConnectionProvisioningState { - /** Succeeded */ - Succeeded = "Succeeded", - /** Creating */ - Creating = "Creating", - /** Deleting */ - Deleting = "Deleting", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for PrivateEndpointConnectionProvisioningState. \ - * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Succeeded** \ - * **Creating** \ - * **Deleting** \ - * **Failed** - */ -export type PrivateEndpointConnectionProvisioningState = string; - -/** Known values of {@link RebootType} that the service accepts. */ -export enum KnownRebootType { - /** PrimaryNode */ - PrimaryNode = "PrimaryNode", - /** SecondaryNode */ - SecondaryNode = "SecondaryNode", - /** AllNodes */ - AllNodes = "AllNodes", -} - -/** - * Defines values for RebootType. \ - * {@link KnownRebootType} can be used interchangeably with RebootType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **PrimaryNode** \ - * **SecondaryNode** \ - * **AllNodes** - */ -export type RebootType = string; - -/** Known values of {@link DefaultName} that the service accepts. */ -export enum KnownDefaultName { - /** Default */ - Default = "default", -} - -/** - * Defines values for DefaultName. \ - * {@link KnownDefaultName} can be used interchangeably with DefaultName, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **default** - */ -export type DefaultName = string; - -/** Known values of {@link AccessPolicyProvisioningState} that the service accepts. */ -export enum KnownAccessPolicyProvisioningState { - /** Updating */ - Updating = "Updating", - /** Succeeded */ - Succeeded = "Succeeded", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for AccessPolicyProvisioningState. \ - * {@link KnownAccessPolicyProvisioningState} can be used interchangeably with AccessPolicyProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Updating** \ - * **Succeeded** \ - * **Deleting** \ - * **Deleted** \ - * **Canceled** \ - * **Failed** - */ -export type AccessPolicyProvisioningState = string; - -/** Known values of {@link AccessPolicyType} that the service accepts. */ -export enum KnownAccessPolicyType { - /** Custom */ - Custom = "Custom", - /** BuiltIn */ - BuiltIn = "BuiltIn", -} - -/** - * Defines values for AccessPolicyType. \ - * {@link KnownAccessPolicyType} can be used interchangeably with AccessPolicyType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Custom** \ - * **BuiltIn** - */ -export type AccessPolicyType = string; - -/** Known values of {@link AccessPolicyAssignmentProvisioningState} that the service accepts. */ -export enum KnownAccessPolicyAssignmentProvisioningState { - /** Updating */ - Updating = "Updating", - /** Succeeded */ - Succeeded = "Succeeded", - /** Deleting */ - Deleting = "Deleting", - /** Deleted */ - Deleted = "Deleted", - /** Canceled */ - Canceled = "Canceled", - /** Failed */ - Failed = "Failed", -} - -/** - * Defines values for AccessPolicyAssignmentProvisioningState. \ - * {@link KnownAccessPolicyAssignmentProvisioningState} can be used interchangeably with AccessPolicyAssignmentProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Updating** \ - * **Succeeded** \ - * **Deleting** \ - * **Deleted** \ - * **Canceled** \ - * **Failed** - */ -export type AccessPolicyAssignmentProvisioningState = string; -/** Defines values for RedisKeyType. */ -export type RedisKeyType = "Primary" | "Secondary"; -/** Defines values for DayOfWeek. */ -export type DayOfWeek = - | "Monday" - | "Tuesday" - | "Wednesday" - | "Thursday" - | "Friday" - | "Saturday" - | "Sunday" - | "Everyday" - | "Weekend"; -/** Defines values for ReplicationRole. */ -export type ReplicationRole = "Primary" | "Secondary"; - -/** Optional parameters. */ -export interface OperationsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type OperationsListResponse = OperationListResult; - -/** Optional parameters. */ -export interface OperationsListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type OperationsListNextResponse = OperationListResult; - -/** Optional parameters. */ -export interface RedisCheckNameAvailabilityOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface RedisListUpgradeNotificationsOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listUpgradeNotifications operation. */ -export type RedisListUpgradeNotificationsResponse = NotificationListResponse; - -/** Optional parameters. */ -export interface RedisCreateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type RedisCreateResponse = RedisResource; - -/** Optional parameters. */ -export interface RedisUpdateOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type RedisUpdateResponse = RedisResource; - -/** Optional parameters. */ -export interface RedisDeleteOptionalParams extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface RedisGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type RedisGetResponse = RedisResource; - -/** Optional parameters. */ -export interface RedisListByResourceGroupOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroup operation. */ -export type RedisListByResourceGroupResponse = RedisListResult; - -/** Optional parameters. */ -export interface RedisListBySubscriptionOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscription operation. */ -export type RedisListBySubscriptionResponse = RedisListResult; - -/** Optional parameters. */ -export interface RedisListKeysOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listKeys operation. */ -export type RedisListKeysResponse = RedisAccessKeys; - -/** Optional parameters. */ -export interface RedisRegenerateKeyOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the regenerateKey operation. */ -export type RedisRegenerateKeyResponse = RedisAccessKeys; - -/** Optional parameters. */ -export interface RedisForceRebootOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the forceReboot operation. */ -export type RedisForceRebootOperationResponse = RedisForceRebootResponse; - -/** Optional parameters. */ -export interface RedisImportDataOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface RedisExportDataOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface RedisFlushCacheOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the flushCache operation. */ -export type RedisFlushCacheResponse = RedisFlushCacheHeaders & - OperationStatusResult; - -/** Optional parameters. */ -export interface RedisListUpgradeNotificationsNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listUpgradeNotificationsNext operation. */ -export type RedisListUpgradeNotificationsNextResponse = - NotificationListResponse; - -/** Optional parameters. */ -export interface RedisListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByResourceGroupNext operation. */ -export type RedisListByResourceGroupNextResponse = RedisListResult; - -/** Optional parameters. */ -export interface RedisListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listBySubscriptionNext operation. */ -export type RedisListBySubscriptionNextResponse = RedisListResult; - -/** Optional parameters. */ -export interface FirewallRulesListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type FirewallRulesListResponse = RedisFirewallRuleListResult; - -/** Optional parameters. */ -export interface FirewallRulesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type FirewallRulesCreateOrUpdateResponse = RedisFirewallRule; - -/** Optional parameters. */ -export interface FirewallRulesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type FirewallRulesGetResponse = RedisFirewallRule; - -/** Optional parameters. */ -export interface FirewallRulesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface FirewallRulesListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type FirewallRulesListNextResponse = RedisFirewallRuleListResult; - -/** Optional parameters. */ -export interface PatchSchedulesListByRedisResourceOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByRedisResource operation. */ -export type PatchSchedulesListByRedisResourceResponse = - RedisPatchScheduleListResult; - -/** Optional parameters. */ -export interface PatchSchedulesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the createOrUpdate operation. */ -export type PatchSchedulesCreateOrUpdateResponse = RedisPatchSchedule; - -/** Optional parameters. */ -export interface PatchSchedulesDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface PatchSchedulesGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PatchSchedulesGetResponse = RedisPatchSchedule; - -/** Optional parameters. */ -export interface PatchSchedulesListByRedisResourceNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByRedisResourceNext operation. */ -export type PatchSchedulesListByRedisResourceNextResponse = - RedisPatchScheduleListResult; - -/** Optional parameters. */ -export interface LinkedServerCreateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the create operation. */ -export type LinkedServerCreateResponse = RedisLinkedServerWithProperties; - -/** Optional parameters. */ -export interface LinkedServerDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface LinkedServerGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type LinkedServerGetResponse = RedisLinkedServerWithProperties; - -/** Optional parameters. */ -export interface LinkedServerListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type LinkedServerListResponse = RedisLinkedServerWithPropertiesList; - -/** Optional parameters. */ -export interface LinkedServerListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type LinkedServerListNextResponse = RedisLinkedServerWithPropertiesList; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type PrivateEndpointConnectionsListResponse = - PrivateEndpointConnectionListResult; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type PrivateEndpointConnectionsGetResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsPutOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the put operation. */ -export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnection; - -/** Optional parameters. */ -export interface PrivateEndpointConnectionsDeleteOptionalParams - extends coreClient.OperationOptions {} - -/** Optional parameters. */ -export interface PrivateLinkResourcesListByRedisCacheOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listByRedisCache operation. */ -export type PrivateLinkResourcesListByRedisCacheResponse = - PrivateLinkResourceListResult; - -/** Optional parameters. */ -export interface AsyncOperationStatusGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AsyncOperationStatusGetResponse = OperationStatus; - -/** Optional parameters. */ -export interface AccessPolicyCreateUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createUpdate operation. */ -export type AccessPolicyCreateUpdateResponse = RedisCacheAccessPolicy; - -/** Optional parameters. */ -export interface AccessPolicyDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface AccessPolicyGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AccessPolicyGetResponse = RedisCacheAccessPolicy; - -/** Optional parameters. */ -export interface AccessPolicyListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type AccessPolicyListResponse = RedisCacheAccessPolicyList; - -/** Optional parameters. */ -export interface AccessPolicyListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type AccessPolicyListNextResponse = RedisCacheAccessPolicyList; - -/** Optional parameters. */ -export interface AccessPolicyAssignmentCreateUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createUpdate operation. */ -export type AccessPolicyAssignmentCreateUpdateResponse = - RedisCacheAccessPolicyAssignment; - -/** Optional parameters. */ -export interface AccessPolicyAssignmentDeleteOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Optional parameters. */ -export interface AccessPolicyAssignmentGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type AccessPolicyAssignmentGetResponse = - RedisCacheAccessPolicyAssignment; - -/** Optional parameters. */ -export interface AccessPolicyAssignmentListOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type AccessPolicyAssignmentListResponse = - RedisCacheAccessPolicyAssignmentList; - -/** Optional parameters. */ -export interface AccessPolicyAssignmentListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type AccessPolicyAssignmentListNextResponse = - RedisCacheAccessPolicyAssignmentList; - -/** Optional parameters. */ -export interface RedisManagementClientOptionalParams - extends coreClient.ServiceClientOptions { - /** server parameter */ - $host?: string; - /** Api Version */ - apiVersion?: string; - /** Overrides client endpoint. */ - endpoint?: string; -} +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export { + Operation, + OperationDisplay, + ErrorResponse, + ErrorDetail, + ErrorAdditionalInfo, + RedisLinkedServerWithProperties, + RedisLinkedServerProperties, + RedisLinkedServerCreateProperties, + ReplicationRole, + ProxyResource, + Resource, + SystemData, + KnownCreatedByType, + CreatedByType, + RedisLinkedServerCreateParameters, + PrivateEndpointConnection, + PrivateEndpointConnectionProperties, + PrivateEndpoint, + PrivateLinkServiceConnectionState, + KnownPrivateEndpointServiceConnectionStatus, + PrivateEndpointServiceConnectionStatus, + KnownPrivateEndpointConnectionProvisioningState, + PrivateEndpointConnectionProvisioningState, + RedisResource, + RedisProperties, + KnownProvisioningState, + ProvisioningState, + RedisAccessKeys, + RedisLinkedServer, + RedisInstanceDetails, + ManagedServiceIdentity, + KnownManagedServiceIdentityType, + ManagedServiceIdentityType, + UserAssignedIdentity, + RedisCreateProperties, + Sku, + KnownSkuName, + SkuName, + KnownSkuFamily, + SkuFamily, + RedisCommonProperties, + RedisCommonPropertiesRedisConfiguration, + KnownTlsVersion, + TlsVersion, + KnownPublicNetworkAccess, + PublicNetworkAccess, + KnownUpdateChannel, + UpdateChannel, + KnownZonalAllocationPolicy, + ZonalAllocationPolicy, + TrackedResource, + RedisCreateParameters, + RedisUpdateParameters, + RedisUpdateProperties, + UpgradeNotification, + RedisRegenerateKeyParameters, + RedisKeyType, + RedisRebootParameters, + KnownRebootType, + RebootType, + RedisForceRebootResponse, + ImportRDBParameters, + ExportRDBParameters, + OperationStatusResult, + CheckNameAvailabilityParameters, + PrivateLinkResource, + PrivateLinkResourceProperties, + RedisFirewallRule, + RedisFirewallRuleProperties, + RedisPatchSchedule, + ScheduleEntries, + ScheduleEntry, + DayOfWeek, + KnownDefaultName, + DefaultName, + RedisCacheAccessPolicy, + RedisCacheAccessPolicyProperties, + KnownAccessPolicyProvisioningState, + AccessPolicyProvisioningState, + KnownAccessPolicyType, + AccessPolicyType, + RedisCacheAccessPolicyAssignment, + RedisCacheAccessPolicyAssignmentProperties, + KnownAccessPolicyAssignmentProvisioningState, + AccessPolicyAssignmentProvisioningState, + OperationStatus, + KnownVersions, +} from "./models.js"; diff --git a/sdk/redis/arm-rediscache/src/models/mappers.ts b/sdk/redis/arm-rediscache/src/models/mappers.ts deleted file mode 100644 index 9194d281c605..000000000000 --- a/sdk/redis/arm-rediscache/src/models/mappers.ts +++ /dev/null @@ -1,2279 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; - -export const OperationListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "Operation", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Operation: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - display: { - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay", - }, - }, - }, - }, -}; - -export const OperationDisplay: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - serializedName: "provider", - type: { - name: "String", - }, - }, - operation: { - serializedName: "operation", - type: { - name: "String", - }, - }, - resource: { - serializedName: "resource", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ErrorResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorResponse", - modelProperties: { - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const ErrorDetail: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorDetail", - modelProperties: { - code: { - serializedName: "code", - readOnly: true, - type: { - name: "String", - }, - }, - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - target: { - serializedName: "target", - readOnly: true, - type: { - name: "String", - }, - }, - details: { - serializedName: "details", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, - additionalInfo: { - serializedName: "additionalInfo", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - }, - }, - }, - }, - }, - }, -}; - -export const ErrorAdditionalInfo: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ErrorAdditionalInfo", - modelProperties: { - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - info: { - serializedName: "info", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const CheckNameAvailabilityParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "CheckNameAvailabilityParameters", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const NotificationListResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "NotificationListResponse", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "UpgradeNotification", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const UpgradeNotification: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UpgradeNotification", - modelProperties: { - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - timestamp: { - serializedName: "timestamp", - readOnly: true, - type: { - name: "DateTime", - }, - }, - upsellNotification: { - serializedName: "upsellNotification", - readOnly: true, - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - }, - }, -}; - -export const RedisCreateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCreateParameters", - modelProperties: { - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, - redisConfiguration: { - serializedName: "properties.redisConfiguration", - type: { - name: "Composite", - className: "RedisCommonPropertiesRedisConfiguration", - }, - }, - redisVersion: { - serializedName: "properties.redisVersion", - type: { - name: "String", - }, - }, - enableNonSslPort: { - defaultValue: false, - serializedName: "properties.enableNonSslPort", - type: { - name: "Boolean", - }, - }, - replicasPerMaster: { - serializedName: "properties.replicasPerMaster", - type: { - name: "Number", - }, - }, - replicasPerPrimary: { - serializedName: "properties.replicasPerPrimary", - type: { - name: "Number", - }, - }, - tenantSettings: { - serializedName: "properties.tenantSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - shardCount: { - serializedName: "properties.shardCount", - type: { - name: "Number", - }, - }, - minimumTlsVersion: { - serializedName: "properties.minimumTlsVersion", - type: { - name: "String", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - updateChannel: { - serializedName: "properties.updateChannel", - type: { - name: "String", - }, - }, - disableAccessKeyAuthentication: { - defaultValue: false, - serializedName: "properties.disableAccessKeyAuthentication", - type: { - name: "Boolean", - }, - }, - zonalAllocationPolicy: { - serializedName: "properties.zonalAllocationPolicy", - type: { - name: "String", - }, - }, - sku: { - serializedName: "properties.sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$", - ), - }, - serializedName: "properties.subnetId", - type: { - name: "String", - }, - }, - staticIP: { - constraints: { - Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+\\.\\d+$"), - }, - serializedName: "properties.staticIP", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Sku: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Sku", - modelProperties: { - name: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, - family: { - serializedName: "family", - required: true, - type: { - name: "String", - }, - }, - capacity: { - serializedName: "capacity", - required: true, - type: { - name: "Number", - }, - }, - }, - }, -}; - -export const RedisCommonProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCommonProperties", - modelProperties: { - redisConfiguration: { - serializedName: "redisConfiguration", - type: { - name: "Composite", - className: "RedisCommonPropertiesRedisConfiguration", - }, - }, - redisVersion: { - serializedName: "redisVersion", - type: { - name: "String", - }, - }, - enableNonSslPort: { - defaultValue: false, - serializedName: "enableNonSslPort", - type: { - name: "Boolean", - }, - }, - replicasPerMaster: { - serializedName: "replicasPerMaster", - type: { - name: "Number", - }, - }, - replicasPerPrimary: { - serializedName: "replicasPerPrimary", - type: { - name: "Number", - }, - }, - tenantSettings: { - serializedName: "tenantSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - shardCount: { - serializedName: "shardCount", - type: { - name: "Number", - }, - }, - minimumTlsVersion: { - serializedName: "minimumTlsVersion", - type: { - name: "String", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "publicNetworkAccess", - type: { - name: "String", - }, - }, - updateChannel: { - serializedName: "updateChannel", - type: { - name: "String", - }, - }, - disableAccessKeyAuthentication: { - defaultValue: false, - serializedName: "disableAccessKeyAuthentication", - type: { - name: "Boolean", - }, - }, - zonalAllocationPolicy: { - serializedName: "zonalAllocationPolicy", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisCommonPropertiesRedisConfiguration: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RedisCommonPropertiesRedisConfiguration", - additionalProperties: { type: { name: "Object" } }, - modelProperties: { - rdbBackupEnabled: { - serializedName: "rdb-backup-enabled", - type: { - name: "String", - }, - }, - rdbBackupFrequency: { - serializedName: "rdb-backup-frequency", - type: { - name: "String", - }, - }, - rdbBackupMaxSnapshotCount: { - serializedName: "rdb-backup-max-snapshot-count", - type: { - name: "String", - }, - }, - rdbStorageConnectionString: { - serializedName: "rdb-storage-connection-string", - type: { - name: "String", - }, - }, - aofBackupEnabled: { - serializedName: "aof-backup-enabled", - type: { - name: "String", - }, - }, - aofStorageConnectionString0: { - serializedName: "aof-storage-connection-string-0", - type: { - name: "String", - }, - }, - aofStorageConnectionString1: { - serializedName: "aof-storage-connection-string-1", - type: { - name: "String", - }, - }, - maxfragmentationmemoryReserved: { - serializedName: "maxfragmentationmemory-reserved", - type: { - name: "String", - }, - }, - maxmemoryPolicy: { - serializedName: "maxmemory-policy", - type: { - name: "String", - }, - }, - maxmemoryReserved: { - serializedName: "maxmemory-reserved", - type: { - name: "String", - }, - }, - maxmemoryDelta: { - serializedName: "maxmemory-delta", - type: { - name: "String", - }, - }, - maxclients: { - serializedName: "maxclients", - readOnly: true, - type: { - name: "String", - }, - }, - notifyKeyspaceEvents: { - serializedName: "notify-keyspace-events", - type: { - name: "String", - }, - }, - preferredDataArchiveAuthMethod: { - serializedName: "preferred-data-archive-auth-method", - readOnly: true, - type: { - name: "String", - }, - }, - preferredDataPersistenceAuthMethod: { - serializedName: "preferred-data-persistence-auth-method", - type: { - name: "String", - }, - }, - zonalConfiguration: { - serializedName: "zonal-configuration", - readOnly: true, - type: { - name: "String", - }, - }, - authnotrequired: { - serializedName: "authnotrequired", - type: { - name: "String", - }, - }, - storageSubscriptionId: { - serializedName: "storage-subscription-id", - type: { - name: "String", - }, - }, - aadEnabled: { - serializedName: "aad-enabled", - type: { - name: "String", - }, - }, - }, - }, - }; - -export const ManagedServiceIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ManagedServiceIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - tenantId: { - serializedName: "tenantId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - type: { - serializedName: "type", - required: true, - type: { - name: "String", - }, - }, - userAssignedIdentities: { - serializedName: "userAssignedIdentities", - type: { - name: "Dictionary", - value: { - type: { name: "Composite", className: "UserAssignedIdentity" }, - }, - }, - }, - }, - }, -}; - -export const UserAssignedIdentity: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "UserAssignedIdentity", - modelProperties: { - principalId: { - serializedName: "principalId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - clientId: { - serializedName: "clientId", - readOnly: true, - type: { - name: "Uuid", - }, - }, - }, - }, -}; - -export const RedisAccessKeys: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisAccessKeys", - modelProperties: { - primaryKey: { - serializedName: "primaryKey", - readOnly: true, - type: { - name: "String", - }, - }, - secondaryKey: { - serializedName: "secondaryKey", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisLinkedServer: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServer", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisInstanceDetails: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisInstanceDetails", - modelProperties: { - sslPort: { - serializedName: "sslPort", - readOnly: true, - type: { - name: "Number", - }, - }, - nonSslPort: { - serializedName: "nonSslPort", - readOnly: true, - type: { - name: "Number", - }, - }, - zone: { - serializedName: "zone", - readOnly: true, - type: { - name: "String", - }, - }, - shardId: { - serializedName: "shardId", - readOnly: true, - type: { - name: "Number", - }, - }, - isMaster: { - serializedName: "isMaster", - readOnly: true, - type: { - name: "Boolean", - }, - }, - isPrimary: { - serializedName: "isPrimary", - readOnly: true, - type: { - name: "Boolean", - }, - }, - }, - }, -}; - -export const PrivateEndpoint: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpoint", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - modelProperties: { - status: { - serializedName: "status", - type: { - name: "String", - }, - }, - description: { - serializedName: "description", - type: { - name: "String", - }, - }, - actionsRequired: { - serializedName: "actionsRequired", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const Resource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "Resource", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", - }, - }, - type: { - serializedName: "type", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisUpdateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisUpdateParameters", - modelProperties: { - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, - redisConfiguration: { - serializedName: "properties.redisConfiguration", - type: { - name: "Composite", - className: "RedisCommonPropertiesRedisConfiguration", - }, - }, - redisVersion: { - serializedName: "properties.redisVersion", - type: { - name: "String", - }, - }, - enableNonSslPort: { - defaultValue: false, - serializedName: "properties.enableNonSslPort", - type: { - name: "Boolean", - }, - }, - replicasPerMaster: { - serializedName: "properties.replicasPerMaster", - type: { - name: "Number", - }, - }, - replicasPerPrimary: { - serializedName: "properties.replicasPerPrimary", - type: { - name: "Number", - }, - }, - tenantSettings: { - serializedName: "properties.tenantSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - shardCount: { - serializedName: "properties.shardCount", - type: { - name: "Number", - }, - }, - minimumTlsVersion: { - serializedName: "properties.minimumTlsVersion", - type: { - name: "String", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - updateChannel: { - serializedName: "properties.updateChannel", - type: { - name: "String", - }, - }, - disableAccessKeyAuthentication: { - defaultValue: false, - serializedName: "properties.disableAccessKeyAuthentication", - type: { - name: "Boolean", - }, - }, - zonalAllocationPolicy: { - serializedName: "properties.zonalAllocationPolicy", - type: { - name: "String", - }, - }, - sku: { - serializedName: "properties.sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - }, - }, -}; - -export const RedisListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisResource", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisRegenerateKeyParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisRegenerateKeyParameters", - modelProperties: { - keyType: { - serializedName: "keyType", - required: true, - type: { - name: "Enum", - allowedValues: ["Primary", "Secondary"], - }, - }, - }, - }, -}; - -export const RedisRebootParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisRebootParameters", - modelProperties: { - rebootType: { - serializedName: "rebootType", - type: { - name: "String", - }, - }, - shardId: { - serializedName: "shardId", - type: { - name: "Number", - }, - }, - ports: { - serializedName: "ports", - type: { - name: "Sequence", - element: { - type: { - name: "Number", - }, - }, - }, - }, - }, - }, -}; - -export const RedisForceRebootResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisForceRebootResponse", - modelProperties: { - message: { - serializedName: "message", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ImportRDBParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ImportRDBParameters", - modelProperties: { - format: { - serializedName: "format", - type: { - name: "String", - }, - }, - files: { - serializedName: "files", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - preferredDataArchiveAuthMethod: { - serializedName: "preferred-data-archive-auth-method", - type: { - name: "String", - }, - }, - storageSubscriptionId: { - serializedName: "storage-subscription-id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ExportRDBParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ExportRDBParameters", - modelProperties: { - format: { - serializedName: "format", - type: { - name: "String", - }, - }, - prefix: { - serializedName: "prefix", - required: true, - type: { - name: "String", - }, - }, - container: { - serializedName: "container", - required: true, - type: { - name: "String", - }, - }, - preferredDataArchiveAuthMethod: { - serializedName: "preferred-data-archive-auth-method", - type: { - name: "String", - }, - }, - storageSubscriptionId: { - serializedName: "storage-subscription-id", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const OperationStatusResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationStatusResult", - modelProperties: { - id: { - serializedName: "id", - type: { - name: "String", - }, - }, - name: { - serializedName: "name", - type: { - name: "String", - }, - }, - status: { - serializedName: "status", - required: true, - type: { - name: "String", - }, - }, - percentComplete: { - constraints: { - InclusiveMaximum: 100, - InclusiveMinimum: 0, - }, - serializedName: "percentComplete", - type: { - name: "Number", - }, - }, - startTime: { - serializedName: "startTime", - type: { - name: "DateTime", - }, - }, - endTime: { - serializedName: "endTime", - type: { - name: "DateTime", - }, - }, - operations: { - serializedName: "operations", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "OperationStatusResult", - }, - }, - }, - }, - error: { - serializedName: "error", - type: { - name: "Composite", - className: "ErrorDetail", - }, - }, - }, - }, -}; - -export const RedisFirewallRuleListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisFirewallRuleListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisFirewallRule", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisPatchScheduleListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisPatchScheduleListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisPatchSchedule", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ScheduleEntry: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ScheduleEntry", - modelProperties: { - dayOfWeek: { - serializedName: "dayOfWeek", - required: true, - type: { - name: "Enum", - allowedValues: [ - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", - "Sunday", - "Everyday", - "Weekend", - ], - }, - }, - startHourUtc: { - serializedName: "startHourUtc", - required: true, - type: { - name: "Number", - }, - }, - maintenanceWindow: { - serializedName: "maintenanceWindow", - type: { - name: "TimeSpan", - }, - }, - }, - }, -}; - -export const RedisLinkedServerCreateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServerCreateParameters", - modelProperties: { - linkedRedisCacheId: { - serializedName: "properties.linkedRedisCacheId", - required: true, - type: { - name: "String", - }, - }, - linkedRedisCacheLocation: { - serializedName: "properties.linkedRedisCacheLocation", - required: true, - type: { - name: "String", - }, - }, - serverRole: { - serializedName: "properties.serverRole", - required: true, - type: { - name: "Enum", - allowedValues: ["Primary", "Secondary"], - }, - }, - geoReplicatedPrimaryHostName: { - serializedName: "properties.geoReplicatedPrimaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - primaryHostName: { - serializedName: "properties.primaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisLinkedServerCreateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServerCreateProperties", - modelProperties: { - linkedRedisCacheId: { - serializedName: "linkedRedisCacheId", - required: true, - type: { - name: "String", - }, - }, - linkedRedisCacheLocation: { - serializedName: "linkedRedisCacheLocation", - required: true, - type: { - name: "String", - }, - }, - serverRole: { - serializedName: "serverRole", - required: true, - type: { - name: "Enum", - allowedValues: ["Primary", "Secondary"], - }, - }, - geoReplicatedPrimaryHostName: { - serializedName: "geoReplicatedPrimaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - primaryHostName: { - serializedName: "primaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisLinkedServerWithPropertiesList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServerWithPropertiesList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisLinkedServerWithProperties", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnectionListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - }, - }, -}; - -export const PrivateLinkResourceListResult: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResourceListResult", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateLinkResource", - }, - }, - }, - }, - }, - }, -}; - -export const RedisCacheAccessPolicyList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCacheAccessPolicyList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisCacheAccessPolicy", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisCacheAccessPolicyAssignmentList: coreClient.CompositeMapper = - { - type: { - name: "Composite", - className: "RedisCacheAccessPolicyAssignmentList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisCacheAccessPolicyAssignment", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, - }; - -export const RedisCreateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCreateProperties", - modelProperties: { - ...RedisCommonProperties.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$", - ), - }, - serializedName: "subnetId", - type: { - name: "String", - }, - }, - staticIP: { - constraints: { - Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+\\.\\d+$"), - }, - serializedName: "staticIP", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisUpdateProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisUpdateProperties", - modelProperties: { - ...RedisCommonProperties.type.modelProperties, - sku: { - serializedName: "sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - }, - }, -}; - -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...Resource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint", - }, - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const TrackedResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "TrackedResource", - modelProperties: { - ...Resource.type.modelProperties, - tags: { - serializedName: "tags", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - location: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const ProxyResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ProxyResource", - modelProperties: { - ...Resource.type.modelProperties, - }, - }, -}; - -export const PrivateLinkResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateLinkResource", - modelProperties: { - ...Resource.type.modelProperties, - groupId: { - serializedName: "properties.groupId", - readOnly: true, - type: { - name: "String", - }, - }, - requiredMembers: { - serializedName: "properties.requiredMembers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - requiredZoneNames: { - serializedName: "properties.requiredZoneNames", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - }, - }, -}; - -export const OperationStatus: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "OperationStatus", - modelProperties: { - ...OperationStatusResult.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Dictionary", - value: { type: { name: "any" } }, - }, - }, - }, - }, -}; - -export const RedisLinkedServerProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServerProperties", - modelProperties: { - ...RedisLinkedServerCreateProperties.type.modelProperties, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisProperties", - modelProperties: { - ...RedisCreateProperties.type.modelProperties, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - hostName: { - serializedName: "hostName", - readOnly: true, - type: { - name: "String", - }, - }, - port: { - serializedName: "port", - readOnly: true, - type: { - name: "Number", - }, - }, - sslPort: { - serializedName: "sslPort", - readOnly: true, - type: { - name: "Number", - }, - }, - accessKeys: { - serializedName: "accessKeys", - type: { - name: "Composite", - className: "RedisAccessKeys", - }, - }, - linkedServers: { - serializedName: "linkedServers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisLinkedServer", - }, - }, - }, - }, - instances: { - serializedName: "instances", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisInstanceDetails", - }, - }, - }, - }, - privateEndpointConnections: { - serializedName: "privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - }, - }, -}; - -export const RedisResource: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisResource", - modelProperties: { - ...TrackedResource.type.modelProperties, - zones: { - serializedName: "zones", - type: { - name: "Sequence", - element: { - type: { - name: "String", - }, - }, - }, - }, - identity: { - serializedName: "identity", - type: { - name: "Composite", - className: "ManagedServiceIdentity", - }, - }, - redisConfiguration: { - serializedName: "properties.redisConfiguration", - type: { - name: "Composite", - className: "RedisCommonPropertiesRedisConfiguration", - }, - }, - redisVersion: { - serializedName: "properties.redisVersion", - type: { - name: "String", - }, - }, - enableNonSslPort: { - defaultValue: false, - serializedName: "properties.enableNonSslPort", - type: { - name: "Boolean", - }, - }, - replicasPerMaster: { - serializedName: "properties.replicasPerMaster", - type: { - name: "Number", - }, - }, - replicasPerPrimary: { - serializedName: "properties.replicasPerPrimary", - type: { - name: "Number", - }, - }, - tenantSettings: { - serializedName: "properties.tenantSettings", - type: { - name: "Dictionary", - value: { type: { name: "String" } }, - }, - }, - shardCount: { - serializedName: "properties.shardCount", - type: { - name: "Number", - }, - }, - minimumTlsVersion: { - serializedName: "properties.minimumTlsVersion", - type: { - name: "String", - }, - }, - publicNetworkAccess: { - defaultValue: "Enabled", - serializedName: "properties.publicNetworkAccess", - type: { - name: "String", - }, - }, - updateChannel: { - serializedName: "properties.updateChannel", - type: { - name: "String", - }, - }, - disableAccessKeyAuthentication: { - defaultValue: false, - serializedName: "properties.disableAccessKeyAuthentication", - type: { - name: "Boolean", - }, - }, - zonalAllocationPolicy: { - serializedName: "properties.zonalAllocationPolicy", - type: { - name: "String", - }, - }, - sku: { - serializedName: "properties.sku", - type: { - name: "Composite", - className: "Sku", - }, - }, - subnetId: { - constraints: { - Pattern: new RegExp( - "^\\/subscriptions\\/[^/]*\\/resourceGroups\\/[^/]*\\/providers\\/Microsoft.(ClassicNetwork|Network)\\/virtualNetworks\\/[^/]*\\/subnets\\/[^/]*$", - ), - }, - serializedName: "properties.subnetId", - type: { - name: "String", - }, - }, - staticIP: { - constraints: { - Pattern: new RegExp("^\\d+\\.\\d+\\.\\d+\\.\\d+$"), - }, - serializedName: "properties.staticIP", - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - hostName: { - serializedName: "properties.hostName", - readOnly: true, - type: { - name: "String", - }, - }, - port: { - serializedName: "properties.port", - readOnly: true, - type: { - name: "Number", - }, - }, - sslPort: { - serializedName: "properties.sslPort", - readOnly: true, - type: { - name: "Number", - }, - }, - accessKeys: { - serializedName: "properties.accessKeys", - type: { - name: "Composite", - className: "RedisAccessKeys", - }, - }, - linkedServers: { - serializedName: "properties.linkedServers", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisLinkedServer", - }, - }, - }, - }, - instances: { - serializedName: "properties.instances", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "RedisInstanceDetails", - }, - }, - }, - }, - privateEndpointConnections: { - serializedName: "properties.privateEndpointConnections", - readOnly: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - }, - }, - }, - }, - }, - }, -}; - -export const RedisFirewallRule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisFirewallRule", - modelProperties: { - ...ProxyResource.type.modelProperties, - startIP: { - serializedName: "properties.startIP", - required: true, - type: { - name: "String", - }, - }, - endIP: { - serializedName: "properties.endIP", - required: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisPatchSchedule: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisPatchSchedule", - modelProperties: { - ...ProxyResource.type.modelProperties, - location: { - serializedName: "location", - readOnly: true, - type: { - name: "String", - }, - }, - scheduleEntries: { - serializedName: "properties.scheduleEntries", - required: true, - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ScheduleEntry", - }, - }, - }, - }, - }, - }, -}; - -export const RedisLinkedServerWithProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisLinkedServerWithProperties", - modelProperties: { - ...ProxyResource.type.modelProperties, - linkedRedisCacheId: { - serializedName: "properties.linkedRedisCacheId", - type: { - name: "String", - }, - }, - linkedRedisCacheLocation: { - serializedName: "properties.linkedRedisCacheLocation", - type: { - name: "String", - }, - }, - serverRole: { - serializedName: "properties.serverRole", - type: { - name: "Enum", - allowedValues: ["Primary", "Secondary"], - }, - }, - geoReplicatedPrimaryHostName: { - serializedName: "properties.geoReplicatedPrimaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - primaryHostName: { - serializedName: "properties.primaryHostName", - readOnly: true, - type: { - name: "String", - }, - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisCacheAccessPolicy: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCacheAccessPolicy", - modelProperties: { - ...ProxyResource.type.modelProperties, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - typePropertiesType: { - serializedName: "properties.type", - readOnly: true, - type: { - name: "String", - }, - }, - permissions: { - serializedName: "properties.permissions", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisCacheAccessPolicyAssignment: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisCacheAccessPolicyAssignment", - modelProperties: { - ...ProxyResource.type.modelProperties, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String", - }, - }, - objectId: { - serializedName: "properties.objectId", - type: { - name: "String", - }, - }, - objectIdAlias: { - serializedName: "properties.objectIdAlias", - type: { - name: "String", - }, - }, - accessPolicyName: { - constraints: { - Pattern: new RegExp( - "^([a-zA-Z0-9][a-zA-Z0-9- ]*[a-zA-Z0-9]|[a-zA-Z0-9])$", - ), - }, - serializedName: "properties.accessPolicyName", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const RedisFirewallRuleCreateParameters: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisFirewallRuleCreateParameters", - modelProperties: { - ...RedisFirewallRule.type.modelProperties, - }, - }, -}; - -export const RedisFlushCacheHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "RedisFlushCacheHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const LinkedServerDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "LinkedServerDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessPolicyDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessPolicyDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const AccessPolicyAssignmentDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AccessPolicyAssignmentDeleteHeaders", - modelProperties: { - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - }, - }, -}; diff --git a/sdk/redis/arm-rediscache/src/models/models.ts b/sdk/redis/arm-rediscache/src/models/models.ts new file mode 100644 index 000000000000..698ee99de7cf --- /dev/null +++ b/sdk/redis/arm-rediscache/src/models/models.ts @@ -0,0 +1,2115 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { serializeRecord } from "../static-helpers/serialization/serialize-record.js"; + +/** Result of the request to list REST API operations. It contains a list of operations and a URL nextLink to get the next set of results. */ +export interface _OperationListResult { + /** List of operations supported by the resource provider. */ + value: Operation[]; + /** URL to get the next set of operation list results if there are any. */ + nextLink?: string; +} + +export function _operationListResultDeserializer(item: any): _OperationListResult { + return { + value: operationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function operationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return operationDeserializer(item); + }); +} + +/** REST API operation */ +export interface Operation { + /** Operation name: {provider}/{resource}/{operation} */ + name?: string; + /** The object that describes the operation. */ + display?: OperationDisplay; +} + +export function operationDeserializer(item: any): Operation { + return { + name: item["name"], + display: !item["display"] ? item["display"] : operationDisplayDeserializer(item["display"]), + }; +} + +/** The object that describes the operation. */ +export interface OperationDisplay { + /** Friendly name of the resource provider */ + provider?: string; + /** Operation type: read, write, delete, listKeys/action, etc. */ + operation?: string; + /** Resource type on which the operation is performed. */ + resource?: string; + /** Friendly name of the operation */ + description?: string; +} + +export function operationDisplayDeserializer(item: any): OperationDisplay { + return { + provider: item["provider"], + operation: item["operation"], + resource: item["resource"], + description: item["description"], + }; +} + +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; +} + +export function errorResponseDeserializer(item: any): ErrorResponse { + return { + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; +} + +export function errorDetailDeserializer(item: any): ErrorDetail { + return { + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), + }; +} + +export function errorDetailArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorDetailDeserializer(item); + }); +} + +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return errorAdditionalInfoDeserializer(item); + }); +} + +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: any; +} + +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { + return { + type: item["type"], + info: item["info"], + }; +} + +/** Response to put/get linked server (with properties) for Redis cache. */ +export interface RedisLinkedServerWithProperties extends ProxyResource { + /** Properties of the linked server. */ + properties?: RedisLinkedServerProperties; +} + +export function redisLinkedServerWithPropertiesDeserializer( + item: any, +): RedisLinkedServerWithProperties { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : redisLinkedServerPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of a linked server to be returned in get/put response */ +export interface RedisLinkedServerProperties extends RedisLinkedServerCreateProperties { + /** Terminal state of the link between primary and secondary redis cache. */ + readonly provisioningState?: string; +} + +export function redisLinkedServerPropertiesDeserializer(item: any): RedisLinkedServerProperties { + return { + linkedRedisCacheId: item["linkedRedisCacheId"], + linkedRedisCacheLocation: item["linkedRedisCacheLocation"], + serverRole: item["serverRole"], + geoReplicatedPrimaryHostName: item["geoReplicatedPrimaryHostName"], + primaryHostName: item["primaryHostName"], + provisioningState: item["provisioningState"], + }; +} + +/** Create properties for a linked server */ +export interface RedisLinkedServerCreateProperties { + /** Fully qualified resourceId of the linked redis cache. */ + linkedRedisCacheId: string; + /** Location of the linked redis cache. */ + linkedRedisCacheLocation: string; + /** Role of the linked server. */ + serverRole: ReplicationRole; + /** The unchanging DNS name which will always point to current geo-primary cache among the linked redis caches for seamless Geo Failover experience. */ + readonly geoReplicatedPrimaryHostName?: string; + /** The changing DNS name that resolves to the current geo-primary cache among the linked redis caches before or after the Geo Failover. */ + readonly primaryHostName?: string; +} + +export function redisLinkedServerCreatePropertiesSerializer( + item: RedisLinkedServerCreateProperties, +): any { + return { + linkedRedisCacheId: item["linkedRedisCacheId"], + linkedRedisCacheLocation: item["linkedRedisCacheLocation"], + serverRole: item["serverRole"], + }; +} + +export function redisLinkedServerCreatePropertiesDeserializer( + item: any, +): RedisLinkedServerCreateProperties { + return { + linkedRedisCacheId: item["linkedRedisCacheId"], + linkedRedisCacheLocation: item["linkedRedisCacheLocation"], + serverRole: item["serverRole"], + geoReplicatedPrimaryHostName: item["geoReplicatedPrimaryHostName"], + primaryHostName: item["primaryHostName"], + }; +} + +/** Role of the linked server. */ +export type ReplicationRole = "Primary" | "Secondary"; + +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ +export interface ProxyResource extends Resource {} + +export function proxyResourceSerializer(item: ProxyResource): any { + return item; +} + +export function proxyResourceDeserializer(item: any): ProxyResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Common fields that are returned in the response for all Azure Resource Manager resources */ +export interface Resource { + /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ + readonly id?: string; + /** The name of the resource */ + readonly name?: string; + /** The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" */ + readonly type?: string; + /** Azure Resource Manager metadata containing createdBy and modifiedBy information. */ + readonly systemData?: SystemData; +} + +export function resourceSerializer(item: Resource): any { + return item; +} + +export function resourceDeserializer(item: any): Resource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + }; +} + +/** Metadata pertaining to creation and last modification of the resource. */ +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; +} + +export function systemDataDeserializer(item: any): SystemData { + return { + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), + }; +} + +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", +} + +/** + * The kind of entity that created the resource. \ + * {@link KnownCreatedByType} can be used interchangeably with CreatedByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; + +/** Parameter required for creating a linked server to redis cache. */ +export interface RedisLinkedServerCreateParameters { + /** Properties required to create a linked server. */ + properties: RedisLinkedServerCreateProperties; +} + +export function redisLinkedServerCreateParametersSerializer( + item: RedisLinkedServerCreateParameters, +): any { + return { + properties: redisLinkedServerCreatePropertiesSerializer(item["properties"]), + }; +} + +/** List of linked servers (with properties) of a Redis cache. */ +export interface _RedisLinkedServerWithPropertiesList { + /** The RedisLinkedServerWithProperties items on this page */ + value: RedisLinkedServerWithProperties[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisLinkedServerWithPropertiesListDeserializer( + item: any, +): _RedisLinkedServerWithPropertiesList { + return { + value: redisLinkedServerWithPropertiesArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisLinkedServerWithPropertiesArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return redisLinkedServerWithPropertiesDeserializer(item); + }); +} + +/** The Private Endpoint Connection resource. */ +export interface PrivateEndpointConnection extends Resource { + /** Resource properties. */ + properties?: PrivateEndpointConnectionProperties; +} + +export function privateEndpointConnectionSerializer(item: PrivateEndpointConnection): any { + return { + properties: !item["properties"] + ? item["properties"] + : privateEndpointConnectionPropertiesSerializer(item["properties"]), + }; +} + +export function privateEndpointConnectionDeserializer(item: any): PrivateEndpointConnection { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : privateEndpointConnectionPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of the private endpoint connection. */ +export interface PrivateEndpointConnectionProperties { + /** The group ids for the private endpoint resource. */ + readonly groupIds?: string[]; + /** The private endpoint resource. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; + /** The provisioning state of the private endpoint connection resource. */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +} + +export function privateEndpointConnectionPropertiesSerializer( + item: PrivateEndpointConnectionProperties, +): any { + return { + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointSerializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateSerializer( + item["privateLinkServiceConnectionState"], + ), + }; +} + +export function privateEndpointConnectionPropertiesDeserializer( + item: any, +): PrivateEndpointConnectionProperties { + return { + groupIds: !item["groupIds"] + ? item["groupIds"] + : item["groupIds"].map((p: any) => { + return p; + }), + privateEndpoint: !item["privateEndpoint"] + ? item["privateEndpoint"] + : privateEndpointDeserializer(item["privateEndpoint"]), + privateLinkServiceConnectionState: privateLinkServiceConnectionStateDeserializer( + item["privateLinkServiceConnectionState"], + ), + provisioningState: item["provisioningState"], + }; +} + +/** The private endpoint resource. */ +export interface PrivateEndpoint { + /** The resource identifier of the private endpoint */ + readonly id?: string; +} + +export function privateEndpointSerializer(item: PrivateEndpoint): any { + return item; +} + +export function privateEndpointDeserializer(item: any): PrivateEndpoint { + return { + id: item["id"], + }; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + +export function privateLinkServiceConnectionStateSerializer( + item: PrivateLinkServiceConnectionState, +): any { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +export function privateLinkServiceConnectionStateDeserializer( + item: any, +): PrivateLinkServiceConnectionState { + return { + status: item["status"], + description: item["description"], + actionsRequired: item["actionsRequired"], + }; +} + +/** The private endpoint connection status. */ +export enum KnownPrivateEndpointServiceConnectionStatus { + /** Connection waiting for approval or rejection */ + Pending = "Pending", + /** Connection approved */ + Approved = "Approved", + /** Connection Rejected */ + Rejected = "Rejected", +} + +/** + * The private endpoint connection status. \ + * {@link KnownPrivateEndpointServiceConnectionStatus} can be used interchangeably with PrivateEndpointServiceConnectionStatus, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Pending**: Connection waiting for approval or rejection \ + * **Approved**: Connection approved \ + * **Rejected**: Connection Rejected + */ +export type PrivateEndpointServiceConnectionStatus = string; + +/** The current provisioning state. */ +export enum KnownPrivateEndpointConnectionProvisioningState { + /** Connection has been provisioned */ + Succeeded = "Succeeded", + /** Connection is being created */ + Creating = "Creating", + /** Connection is being deleted */ + Deleting = "Deleting", + /** Connection provisioning has failed */ + Failed = "Failed", +} + +/** + * The current provisioning state. \ + * {@link KnownPrivateEndpointConnectionProvisioningState} can be used interchangeably with PrivateEndpointConnectionProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Succeeded**: Connection has been provisioned \ + * **Creating**: Connection is being created \ + * **Deleting**: Connection is being deleted \ + * **Failed**: Connection provisioning has failed + */ +export type PrivateEndpointConnectionProvisioningState = string; + +/** The response of a PrivateEndpointConnection list operation. */ +export interface _PrivateEndpointConnectionListResult { + /** The PrivateEndpointConnection items on this page */ + value: PrivateEndpointConnection[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _privateEndpointConnectionListResultDeserializer( + item: any, +): _PrivateEndpointConnectionListResult { + return { + value: privateEndpointConnectionArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function privateEndpointConnectionArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionSerializer(item); + }); +} + +export function privateEndpointConnectionArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return privateEndpointConnectionDeserializer(item); + }); +} + +/** A single Redis item in List or Get Operation. */ +export interface RedisResource extends TrackedResource { + /** Redis cache properties. */ + properties: RedisProperties; + /** The availability zones. */ + zones?: string[]; + /** The managed service identities assigned to this resource. */ + identity?: ManagedServiceIdentity; +} + +export function redisResourceDeserializer(item: any): RedisResource { + return { + tags: item["tags"], + location: item["location"], + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: redisPropertiesDeserializer(item["properties"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentityDeserializer(item["identity"]), + }; +} + +/** Properties of the redis cache. */ +export interface RedisProperties extends RedisCreateProperties { + /** Redis instance provisioning status. */ + readonly provisioningState?: ProvisioningState; + /** Redis host name. */ + readonly hostName?: string; + /** Redis non-SSL port. */ + readonly port?: number; + /** Redis SSL port. */ + readonly sslPort?: number; + /** The keys of the Redis cache - not set if this object is not the response to Create or Update redis cache */ + readonly accessKeys?: RedisAccessKeys; + /** List of the linked servers associated with the cache */ + readonly linkedServers?: RedisLinkedServer[]; + /** List of the Redis instances associated with the cache */ + readonly instances?: RedisInstanceDetails[]; + /** List of private endpoint connection associated with the specified redis cache */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; +} + +export function redisPropertiesDeserializer(item: any): RedisProperties { + return { + sku: skuDeserializer(item["sku"]), + subnetId: item["subnetId"], + staticIP: item["staticIP"], + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationDeserializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + provisioningState: item["provisioningState"], + hostName: item["hostName"], + port: item["port"], + sslPort: item["sslPort"], + accessKeys: !item["accessKeys"] + ? item["accessKeys"] + : redisAccessKeysDeserializer(item["accessKeys"]), + linkedServers: !item["linkedServers"] + ? item["linkedServers"] + : redisLinkedServerArrayDeserializer(item["linkedServers"]), + instances: !item["instances"] + ? item["instances"] + : redisInstanceDetailsArrayDeserializer(item["instances"]), + privateEndpointConnections: !item["privateEndpointConnections"] + ? item["privateEndpointConnections"] + : privateEndpointConnectionArrayDeserializer(item["privateEndpointConnections"]), + }; +} + +/** Redis instance provisioning status. */ +export enum KnownProvisioningState { + /** A create operation is in progress. */ + Creating = "Creating", + /** A delete operation is in progress. */ + Deleting = "Deleting", + /** The cache is disabled and cannot be used. */ + Disabled = "Disabled", + /** An operation such as create or update failed. If you failed to create the cache it will not be in a usable state, so you should delete and recreate it. */ + Failed = "Failed", + /** Georeplication link is in progress */ + Linking = "Linking", + /** An operation is in progress */ + Provisioning = "Provisioning", + /** A scaling operation encountered an error and recovery is in progress. */ + RecoveringScaleFailure = "RecoveringScaleFailure", + /** A scaling operation is in progress */ + Scaling = "Scaling", + /** The most recent operation successfully completed */ + Succeeded = "Succeeded", + /** Georeplication unlink is in progress */ + Unlinking = "Unlinking", + /** The cache may be being disabled */ + Unprovisioning = "Unprovisioning", + /** An update operation is in progress. */ + Updating = "Updating", + /** An AAD configuration update operation is in progress. */ + ConfiguringAAD = "ConfiguringAAD", +} + +/** + * Redis instance provisioning status. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Creating**: A create operation is in progress. \ + * **Deleting**: A delete operation is in progress. \ + * **Disabled**: The cache is disabled and cannot be used. \ + * **Failed**: An operation such as create or update failed. If you failed to create the cache it will not be in a usable state, so you should delete and recreate it. \ + * **Linking**: Georeplication link is in progress \ + * **Provisioning**: An operation is in progress \ + * **RecoveringScaleFailure**: A scaling operation encountered an error and recovery is in progress. \ + * **Scaling**: A scaling operation is in progress \ + * **Succeeded**: The most recent operation successfully completed \ + * **Unlinking**: Georeplication unlink is in progress \ + * **Unprovisioning**: The cache may be being disabled \ + * **Updating**: An update operation is in progress. \ + * **ConfiguringAAD**: An AAD configuration update operation is in progress. + */ +export type ProvisioningState = string; + +/** Redis cache access keys. */ +export interface RedisAccessKeys { + /** The current primary key that clients can use to authenticate with Redis cache. */ + readonly primaryKey?: string; + /** The current secondary key that clients can use to authenticate with Redis cache. */ + readonly secondaryKey?: string; +} + +export function redisAccessKeysDeserializer(item: any): RedisAccessKeys { + return { + primaryKey: item["primaryKey"], + secondaryKey: item["secondaryKey"], + }; +} + +export function redisLinkedServerArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return redisLinkedServerDeserializer(item); + }); +} + +/** Linked server Id */ +export interface RedisLinkedServer { + /** Linked server Id. */ + readonly id?: string; +} + +export function redisLinkedServerDeserializer(item: any): RedisLinkedServer { + return { + id: item["id"], + }; +} + +export function redisInstanceDetailsArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return redisInstanceDetailsDeserializer(item); + }); +} + +/** Details of single instance of redis. */ +export interface RedisInstanceDetails { + /** Redis instance SSL port. */ + readonly sslPort?: number; + /** If enableNonSslPort is true, provides Redis instance Non-SSL port. */ + readonly nonSslPort?: number; + /** If the Cache uses availability zones, specifies availability zone where this instance is located. */ + readonly zone?: string; + /** If clustering is enabled, the Shard ID of Redis Instance */ + readonly shardId?: number; + /** Specifies whether the instance is a primary node. */ + readonly isMaster?: boolean; + /** Specifies whether the instance is a primary node. */ + readonly isPrimary?: boolean; +} + +export function redisInstanceDetailsDeserializer(item: any): RedisInstanceDetails { + return { + sslPort: item["sslPort"], + nonSslPort: item["nonSslPort"], + zone: item["zone"], + shardId: item["shardId"], + isMaster: item["isMaster"], + isPrimary: item["isPrimary"], + }; +} + +/** Managed service identity (system assigned and/or user assigned identities) */ +export interface ManagedServiceIdentity { + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; + /** The type of managed identity assigned to this resource. */ + type: ManagedServiceIdentityType; + /** The identities assigned to this resource by the user. */ + userAssignedIdentities?: Record; +} + +export function managedServiceIdentitySerializer(item: ManagedServiceIdentity): any { + return { + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordSerializer(item["userAssignedIdentities"]), + }; +} + +export function managedServiceIdentityDeserializer(item: any): ManagedServiceIdentity { + return { + principalId: item["principalId"], + tenantId: item["tenantId"], + type: item["type"], + userAssignedIdentities: !item["userAssignedIdentities"] + ? item["userAssignedIdentities"] + : userAssignedIdentityRecordDeserializer(item["userAssignedIdentities"]), + }; +} + +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ +export enum KnownManagedServiceIdentityType { + /** No managed identity. */ + None = "None", + /** System assigned managed identity. */ + SystemAssigned = "SystemAssigned", + /** User assigned managed identity. */ + UserAssigned = "UserAssigned", + /** System and user assigned managed identity. */ + SystemAssignedUserAssigned = "SystemAssigned, UserAssigned", +} + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). \ + * {@link KnownManagedServiceIdentityType} can be used interchangeably with ManagedServiceIdentityType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **None**: No managed identity. \ + * **SystemAssigned**: System assigned managed identity. \ + * **UserAssigned**: User assigned managed identity. \ + * **SystemAssigned, UserAssigned**: System and user assigned managed identity. + */ +export type ManagedServiceIdentityType = string; + +export function userAssignedIdentityRecordSerializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentitySerializer(item[key]); + }); + return result; +} + +export function userAssignedIdentityRecordDeserializer( + item: Record, +): Record { + const result: Record = {}; + Object.keys(item).map((key) => { + result[key] = !item[key] ? item[key] : userAssignedIdentityDeserializer(item[key]); + }); + return result; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity { + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +export function userAssignedIdentitySerializer(item: UserAssignedIdentity): any { + return item; +} + +export function userAssignedIdentityDeserializer(item: any): UserAssignedIdentity { + return { + principalId: item["principalId"], + clientId: item["clientId"], + }; +} + +/** Properties supplied to Create Redis operation. */ +export interface RedisCreateProperties extends RedisCommonProperties { + /** The SKU of the Redis cache to deploy. */ + sku: Sku; + /** The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1 */ + subnetId?: string; + /** Static IP address. Optionally, may be specified when deploying a Redis cache inside an existing Azure Virtual Network; auto assigned by default. */ + staticIP?: string; +} + +export function redisCreatePropertiesSerializer(item: RedisCreateProperties): any { + return { + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationSerializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + sku: skuSerializer(item["sku"]), + subnetId: item["subnetId"], + staticIP: item["staticIP"], + }; +} + +export function redisCreatePropertiesDeserializer(item: any): RedisCreateProperties { + return { + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationDeserializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + sku: skuDeserializer(item["sku"]), + subnetId: item["subnetId"], + staticIP: item["staticIP"], + }; +} + +/** SKU parameters supplied to the create Redis operation. */ +export interface Sku { + /** The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium) */ + name: SkuName; + /** The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). */ + family: SkuFamily; + /** The size of the Redis cache to deploy. Valid values: for C (Basic/Standard) family (0, 1, 2, 3, 4, 5, 6), for P (Premium) family (1, 2, 3, 4). */ + capacity: number; +} + +export function skuSerializer(item: Sku): any { + return { + name: item["name"], + family: item["family"], + capacity: item["capacity"], + }; +} + +export function skuDeserializer(item: any): Sku { + return { + name: item["name"], + family: item["family"], + capacity: item["capacity"], + }; +} + +/** The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium) */ +export enum KnownSkuName { + /** The well known 'Basic' SKU for Azure Cache for Redis. Basic SKU does not have an availability SLA. */ + Basic = "Basic", + /** The well known 'Standard' SKU for Azure Cache for Redis. Standard SKU has an availability SLA. */ + Standard = "Standard", + /** The well known 'Premium' SKU for Azure Cache for Redis. Premium SKU has an availability SLA, and higher performance tiers and more features compared with Standard SKU. */ + Premium = "Premium", +} + +/** + * The type of Redis cache to deploy. Valid values: (Basic, Standard, Premium) \ + * {@link KnownSkuName} can be used interchangeably with SkuName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Basic**: The well known 'Basic' SKU for Azure Cache for Redis. Basic SKU does not have an availability SLA. \ + * **Standard**: The well known 'Standard' SKU for Azure Cache for Redis. Standard SKU has an availability SLA. \ + * **Premium**: The well known 'Premium' SKU for Azure Cache for Redis. Premium SKU has an availability SLA, and higher performance tiers and more features compared with Standard SKU. + */ +export type SkuName = string; + +/** The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). */ +export enum KnownSkuFamily { + /** The SKU family to use - must be 'C' for Basic/Standard SKU redis caches. */ + C = "C", + /** The SKU family to use - must be 'P' for Premium SKU redis caches. */ + P = "P", +} + +/** + * The SKU family to use. Valid values: (C, P). (C = Basic/Standard, P = Premium). \ + * {@link KnownSkuFamily} can be used interchangeably with SkuFamily, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **C**: The SKU family to use - must be 'C' for Basic\/Standard SKU redis caches. \ + * **P**: The SKU family to use - must be 'P' for Premium SKU redis caches. + */ +export type SkuFamily = string; + +/** Create/Update/Get common properties of the redis cache. */ +export interface RedisCommonProperties { + /** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ + redisConfiguration?: RedisCommonPropertiesRedisConfiguration; + /** Redis version. This should be in the form 'major[.minor]' (only 'major' is required) or the value 'latest' which refers to the latest stable Redis version that is available. Supported versions: 4.0, 6.0 (latest). Default value is 'latest'. */ + redisVersion?: string; + /** Specifies whether the non-ssl Redis server port (6379) is enabled. */ + enableNonSslPort?: boolean; + /** The number of replicas to be created per primary. */ + replicasPerMaster?: number; + /** The number of replicas to be created per primary. */ + replicasPerPrimary?: number; + /** A dictionary of tenant settings */ + tenantSettings?: Record; + /** The number of shards to be created on a Premium Cluster Cache. */ + shardCount?: number; + /** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ + minimumTlsVersion?: TlsVersion; + /** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. */ + publicNetworkAccess?: PublicNetworkAccess; + /** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ + updateChannel?: UpdateChannel; + /** Authentication to Redis through access keys is disabled when set as true. Default value is false. */ + disableAccessKeyAuthentication?: boolean; + /** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ + zonalAllocationPolicy?: ZonalAllocationPolicy; +} + +export function redisCommonPropertiesSerializer(item: RedisCommonProperties): any { + return { + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationSerializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + }; +} + +export function redisCommonPropertiesDeserializer(item: any): RedisCommonProperties { + return { + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationDeserializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + }; +} + +/** All Redis Settings. Few possible keys: rdb-backup-enabled,rdb-storage-connection-string,rdb-backup-frequency,maxmemory-delta, maxmemory-policy,notify-keyspace-events, aof-backup-enabled, aof-storage-connection-string-0, aof-storage-connection-string-1 etc. */ +export interface RedisCommonPropertiesRedisConfiguration { + /** Specifies whether the RDB backup is enabled */ + rdbBackupEnabled?: string; + /** Specifies the frequency for creating rdb backup in minutes. Valid values: (15, 30, 60, 360, 720, 1440) */ + rdbBackupFrequency?: string; + /** Specifies the maximum number of snapshots for rdb backup */ + rdbBackupMaxSnapshotCount?: string; + /** The storage account connection string for storing rdb file */ + rdbStorageConnectionString?: string; + /** Specifies whether the aof backup is enabled */ + aofBackupEnabled?: string; + /** First storage account connection string */ + aofStorageConnectionString0?: string; + /** Second storage account connection string */ + aofStorageConnectionString1?: string; + /** Value in megabytes reserved for fragmentation per shard */ + maxfragmentationmemoryReserved?: string; + /** The eviction strategy used when your data won't fit within its memory limit. */ + maxmemoryPolicy?: string; + /** Value in megabytes reserved for non-cache usage per shard e.g. failover. */ + maxmemoryReserved?: string; + /** Value in megabytes reserved for non-cache usage per shard e.g. failover. */ + maxmemoryDelta?: string; + /** The max clients config */ + readonly maxclients?: string; + /** The keyspace events which should be monitored. */ + notifyKeyspaceEvents?: string; + /** Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS */ + readonly preferredDataArchiveAuthMethod?: string; + /** Preferred auth method to communicate to storage account used for data persistence, specify SAS or ManagedIdentity, default value is SAS */ + preferredDataPersistenceAuthMethod?: string; + /** Zonal Configuration */ + readonly zonalConfiguration?: string; + /** Specifies whether the authentication is disabled. Setting this property is highly discouraged from security point of view; you should never disable authentication using this property! */ + authnotrequired?: string; + /** SubscriptionId of the storage account for persistence (aof/rdb) using ManagedIdentity. */ + storageSubscriptionId?: string; + /** Specifies whether AAD based authentication has been enabled or disabled for the cache */ + aadEnabled?: string; + /** Additional properties */ + additionalProperties?: Record; +} + +export function redisCommonPropertiesRedisConfigurationSerializer( + item: RedisCommonPropertiesRedisConfiguration, +): any { + return { + ...serializeRecord(item.additionalProperties), + "rdb-backup-enabled": item["rdbBackupEnabled"], + "rdb-backup-frequency": item["rdbBackupFrequency"], + "rdb-backup-max-snapshot-count": item["rdbBackupMaxSnapshotCount"], + "rdb-storage-connection-string": item["rdbStorageConnectionString"], + "aof-backup-enabled": item["aofBackupEnabled"], + "aof-storage-connection-string-0": item["aofStorageConnectionString0"], + "aof-storage-connection-string-1": item["aofStorageConnectionString1"], + "maxfragmentationmemory-reserved": item["maxfragmentationmemoryReserved"], + "maxmemory-policy": item["maxmemoryPolicy"], + "maxmemory-reserved": item["maxmemoryReserved"], + "maxmemory-delta": item["maxmemoryDelta"], + "notify-keyspace-events": item["notifyKeyspaceEvents"], + "preferred-data-persistence-auth-method": item["preferredDataPersistenceAuthMethod"], + authnotrequired: item["authnotrequired"], + "storage-subscription-id": item["storageSubscriptionId"], + "aad-enabled": item["aadEnabled"], + }; +} + +export function redisCommonPropertiesRedisConfigurationDeserializer( + item: any, +): RedisCommonPropertiesRedisConfiguration { + return { + additionalProperties: serializeRecord(item, [ + "rdbBackupEnabled", + "rdbBackupFrequency", + "rdbBackupMaxSnapshotCount", + "rdbStorageConnectionString", + "aofBackupEnabled", + "aofStorageConnectionString0", + "aofStorageConnectionString1", + "maxfragmentationmemoryReserved", + "maxmemoryPolicy", + "maxmemoryReserved", + "maxmemoryDelta", + "maxclients", + "notifyKeyspaceEvents", + "preferredDataArchiveAuthMethod", + "preferredDataPersistenceAuthMethod", + "zonalConfiguration", + "authnotrequired", + "storageSubscriptionId", + "aadEnabled", + ]), + rdbBackupEnabled: item["rdb-backup-enabled"], + rdbBackupFrequency: item["rdb-backup-frequency"], + rdbBackupMaxSnapshotCount: item["rdb-backup-max-snapshot-count"], + rdbStorageConnectionString: item["rdb-storage-connection-string"], + aofBackupEnabled: item["aof-backup-enabled"], + aofStorageConnectionString0: item["aof-storage-connection-string-0"], + aofStorageConnectionString1: item["aof-storage-connection-string-1"], + maxfragmentationmemoryReserved: item["maxfragmentationmemory-reserved"], + maxmemoryPolicy: item["maxmemory-policy"], + maxmemoryReserved: item["maxmemory-reserved"], + maxmemoryDelta: item["maxmemory-delta"], + maxclients: item["maxclients"], + notifyKeyspaceEvents: item["notify-keyspace-events"], + preferredDataArchiveAuthMethod: item["preferred-data-archive-auth-method"], + preferredDataPersistenceAuthMethod: item["preferred-data-persistence-auth-method"], + zonalConfiguration: item["zonal-configuration"], + authnotrequired: item["authnotrequired"], + storageSubscriptionId: item["storage-subscription-id"], + aadEnabled: item["aad-enabled"], + }; +} + +/** Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') */ +export enum KnownTlsVersion { + /** TLS protocol version 1.0 -- deprecated for security reasons. Do not use this value for new caches. */ + One0 = "1.0", + /** TLS protocol version 1.1 -- deprecated for security reasons. Do not use this value for new caches. */ + One1 = "1.1", + /** TLS protocol version 1.2 -- use this value, or higher, for new caches. Or do not specify, so that your cache uses the recommended default value */ + One2 = "1.2", +} + +/** + * Optional: requires clients to use a specified TLS version (or higher) to connect (e,g, '1.0', '1.1', '1.2') \ + * {@link KnownTlsVersion} can be used interchangeably with TlsVersion, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **1.0**: TLS protocol version 1.0 -- deprecated for security reasons. Do not use this value for new caches. \ + * **1.1**: TLS protocol version 1.1 -- deprecated for security reasons. Do not use this value for new caches. \ + * **1.2**: TLS protocol version 1.2 -- use this value, or higher, for new caches. Or do not specify, so that your cache uses the recommended default value + */ +export type TlsVersion = string; + +/** Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' */ +export enum KnownPublicNetworkAccess { + /** Public internet access to the cache, via its public IP address, is enabled. Connections may use any network path. */ + Enabled = "Enabled", + /** Public internet access to the cache, via its public IP address, is disabled. Connections must use be made via private endpoints. */ + Disabled = "Disabled", +} + +/** + * Whether or not public endpoint access is allowed for this cache. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. If 'Disabled', private endpoints are the exclusive access method. Default value is 'Enabled' \ + * {@link KnownPublicNetworkAccess} can be used interchangeably with PublicNetworkAccess, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Enabled**: Public internet access to the cache, via its public IP address, is enabled. Connections may use any network path. \ + * **Disabled**: Public internet access to the cache, via its public IP address, is disabled. Connections must use be made via private endpoints. + */ +export type PublicNetworkAccess = string; + +/** Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. */ +export enum KnownUpdateChannel { + /** Stable channel receives updates, which may include important security and stability updates, later than Preview channel. */ + Stable = "Stable", + /** Preview channel normally receives updates before Stable channel, and is the recommended channel for non-production workloads. */ + Preview = "Preview", +} + +/** + * Optional: Specifies the update channel for the monthly Redis updates your Redis Cache will receive. Caches using 'Preview' update channel get latest Redis updates at least 4 weeks ahead of 'Stable' channel caches. Default value is 'Stable'. \ + * {@link KnownUpdateChannel} can be used interchangeably with UpdateChannel, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Stable**: Stable channel receives updates, which may include important security and stability updates, later than Preview channel. \ + * **Preview**: Preview channel normally receives updates before Stable channel, and is the recommended channel for non-production workloads. + */ +export type UpdateChannel = string; + +/** Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. */ +export enum KnownZonalAllocationPolicy { + /** The zones for the cache will be selected automatically based on availability and capacity. */ + Automatic = "Automatic", + /** UserDefined means the zones for the cache are manually configured using the 'zones' property, and can not be automatically selected. */ + UserDefined = "UserDefined", + /** The cache will not use multiple availability zones. */ + NoZones = "NoZones", +} + +/** + * Optional: Specifies how availability zones are allocated to the Redis cache. 'Automatic' enables zone redundancy and Azure will automatically select zones based on regional availability and capacity. 'UserDefined' will select availability zones passed in by you using the 'zones' parameter. 'NoZones' will produce a non-zonal cache. If 'zonalAllocationPolicy' is not passed, it will be set to 'UserDefined' when zones are passed in, otherwise, it will be set to 'Automatic' in regions where zones are supported and 'NoZones' in regions where zones are not supported. \ + * {@link KnownZonalAllocationPolicy} can be used interchangeably with ZonalAllocationPolicy, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Automatic**: The zones for the cache will be selected automatically based on availability and capacity. \ + * **UserDefined**: UserDefined means the zones for the cache are manually configured using the 'zones' property, and can not be automatically selected. \ + * **NoZones**: The cache will not use multiple availability zones. + */ +export type ZonalAllocationPolicy = string; + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + +/** Parameters supplied to the Create Redis operation. */ +export interface RedisCreateParameters { + /** Redis cache properties. */ + properties: RedisCreateProperties; + /** A list of availability zones denoting where the resource needs to come from. */ + zones?: string[]; + /** The geo-location where the resource lives */ + location: string; + /** Resource tags. */ + tags?: Record; + /** The identity of the resource. */ + identity?: ManagedServiceIdentity; +} + +export function redisCreateParametersSerializer(item: RedisCreateParameters): any { + return { + properties: redisCreatePropertiesSerializer(item["properties"]), + zones: !item["zones"] + ? item["zones"] + : item["zones"].map((p: any) => { + return p; + }), + location: item["location"], + tags: item["tags"], + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +/** Parameters supplied to the Update Redis operation. */ +export interface RedisUpdateParameters { + /** Redis cache properties. */ + properties?: RedisUpdateProperties; + /** Resource tags. */ + tags?: Record; + /** The identity of the resource. */ + identity?: ManagedServiceIdentity; +} + +export function redisUpdateParametersSerializer(item: RedisUpdateParameters): any { + return { + properties: !item["properties"] + ? item["properties"] + : redisUpdatePropertiesSerializer(item["properties"]), + tags: item["tags"], + identity: !item["identity"] + ? item["identity"] + : managedServiceIdentitySerializer(item["identity"]), + }; +} + +/** Patchable properties of the redis cache. */ +export interface RedisUpdateProperties extends RedisCommonProperties { + /** The SKU of the Redis cache to deploy. */ + sku?: Sku; +} + +export function redisUpdatePropertiesSerializer(item: RedisUpdateProperties): any { + return { + redisConfiguration: !item["redisConfiguration"] + ? item["redisConfiguration"] + : redisCommonPropertiesRedisConfigurationSerializer(item["redisConfiguration"]), + redisVersion: item["redisVersion"], + enableNonSslPort: item["enableNonSslPort"], + replicasPerMaster: item["replicasPerMaster"], + replicasPerPrimary: item["replicasPerPrimary"], + tenantSettings: item["tenantSettings"], + shardCount: item["shardCount"], + minimumTlsVersion: item["minimumTlsVersion"], + publicNetworkAccess: item["publicNetworkAccess"], + updateChannel: item["updateChannel"], + disableAccessKeyAuthentication: item["disableAccessKeyAuthentication"], + zonalAllocationPolicy: item["zonalAllocationPolicy"], + sku: !item["sku"] ? item["sku"] : skuSerializer(item["sku"]), + }; +} + +/** The response of list Redis operation. */ +export interface _RedisListResult { + /** The RedisResource items on this page */ + value: RedisResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisListResultDeserializer(item: any): _RedisListResult { + return { + value: redisResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return redisResourceDeserializer(item); + }); +} + +/** The response of listUpgradeNotifications. */ +export interface _NotificationListResponse { + /** The UpgradeNotification items on this page */ + value: UpgradeNotification[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _notificationListResponseDeserializer(item: any): _NotificationListResponse { + return { + value: upgradeNotificationArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function upgradeNotificationArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return upgradeNotificationDeserializer(item); + }); +} + +/** Properties of upgrade notification. */ +export interface UpgradeNotification { + /** Name of upgrade notification. */ + readonly name?: string; + /** Timestamp when upgrade notification occurred. */ + readonly timestamp?: Date; + /** Details about this upgrade notification */ + readonly upsellNotification?: Record; +} + +export function upgradeNotificationDeserializer(item: any): UpgradeNotification { + return { + name: item["name"], + timestamp: !item["timestamp"] ? item["timestamp"] : new Date(item["timestamp"]), + upsellNotification: item["upsellNotification"], + }; +} + +/** Specifies which Redis access keys to reset. */ +export interface RedisRegenerateKeyParameters { + /** The Redis access key to regenerate. */ + keyType: RedisKeyType; +} + +export function redisRegenerateKeyParametersSerializer(item: RedisRegenerateKeyParameters): any { + return { keyType: item["keyType"] }; +} + +/** The Redis access key to regenerate. */ +export type RedisKeyType = "Primary" | "Secondary"; + +/** Specifies which Redis node(s) to reboot. */ +export interface RedisRebootParameters { + /** Which Redis node(s) to reboot. Depending on this value data loss is possible. */ + rebootType?: RebootType; + /** If clustering is enabled, the ID of the shard to be rebooted. */ + shardId?: number; + /** A list of redis instances to reboot, specified by per-instance SSL ports or non-SSL ports. */ + ports?: number[]; +} + +export function redisRebootParametersSerializer(item: RedisRebootParameters): any { + return { + rebootType: item["rebootType"], + shardId: item["shardId"], + ports: !item["ports"] + ? item["ports"] + : item["ports"].map((p: any) => { + return p; + }), + }; +} + +/** Which Redis node(s) to reboot. Depending on this value data loss is possible. */ +export enum KnownRebootType { + /** Reboot the primary nodes used for redis write operations. (This may trigger role changes.) */ + PrimaryNode = "PrimaryNode", + /** Reboot only the secondary or replica nodes */ + SecondaryNode = "SecondaryNode", + /** Reboot all nodes, not guaranteed to happen simultaneously. */ + AllNodes = "AllNodes", +} + +/** + * Which Redis node(s) to reboot. Depending on this value data loss is possible. \ + * {@link KnownRebootType} can be used interchangeably with RebootType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **PrimaryNode**: Reboot the primary nodes used for redis write operations. (This may trigger role changes.) \ + * **SecondaryNode**: Reboot only the secondary or replica nodes \ + * **AllNodes**: Reboot all nodes, not guaranteed to happen simultaneously. + */ +export type RebootType = string; + +/** Response to force reboot for Redis cache. */ +export interface RedisForceRebootResponse { + /** Status message */ + readonly message?: string; +} + +export function redisForceRebootResponseDeserializer(item: any): RedisForceRebootResponse { + return { + message: item["message"], + }; +} + +/** Parameters for Redis import operation. */ +export interface ImportRDBParameters { + /** File format. */ + format?: string; + /** files to import. */ + files: string[]; + /** Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS */ + preferredDataArchiveAuthMethod?: string; + /** Subscription id of the storage container containing files to import using Managed Identity. */ + storageSubscriptionId?: string; +} + +export function importRDBParametersSerializer(item: ImportRDBParameters): any { + return { + format: item["format"], + files: item["files"].map((p: any) => { + return p; + }), + "preferred-data-archive-auth-method": item["preferredDataArchiveAuthMethod"], + "storage-subscription-id": item["storageSubscriptionId"], + }; +} + +/** Parameters for Redis export operation. */ +export interface ExportRDBParameters { + /** File format. */ + format?: string; + /** Prefix to use for exported files. */ + prefix: string; + /** Container name to export to. */ + container: string; + /** Preferred auth method to communicate to storage account used for data archive, specify SAS or ManagedIdentity, default value is SAS */ + preferredDataArchiveAuthMethod?: string; + /** Subscription id of the storage container for data to be exported using ManagedIdentity. */ + storageSubscriptionId?: string; +} + +export function exportRDBParametersSerializer(item: ExportRDBParameters): any { + return { + format: item["format"], + prefix: item["prefix"], + container: item["container"], + "preferred-data-archive-auth-method": item["preferredDataArchiveAuthMethod"], + "storage-subscription-id": item["storageSubscriptionId"], + }; +} + +/** The current status of an async operation. */ +export interface OperationStatusResult { + /** Fully qualified ID for the async operation. */ + id?: string; + /** Name of the async operation. */ + name?: string; + /** Operation status. */ + status: string; + /** Percent of the operation that is complete. */ + percentComplete?: number; + /** The start time of the operation. */ + startTime?: Date; + /** The end time of the operation. */ + endTime?: Date; + /** The operations list. */ + operations?: OperationStatusResult[]; + /** If present, details of the operation error. */ + error?: ErrorDetail; +} + +export function operationStatusResultDeserializer(item: any): OperationStatusResult { + return { + id: item["id"], + name: item["name"], + status: item["status"], + percentComplete: item["percentComplete"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + operations: !item["operations"] + ? item["operations"] + : operationStatusResultArrayDeserializer(item["operations"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + }; +} + +export function operationStatusResultArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return operationStatusResultDeserializer(item); + }); +} + +/** Parameters body to pass for resource name availability check. */ +export interface CheckNameAvailabilityParameters { + /** Resource name. */ + name: string; + /** Resource type. The only legal value of this property for checking redis cache name availability is 'Microsoft.Cache/redis'. */ + type: string; +} + +export function checkNameAvailabilityParametersSerializer( + item: CheckNameAvailabilityParameters, +): any { + return { name: item["name"], type: item["type"] }; +} + +/** The response of a PrivateLinkResource list operation. */ +export interface _PrivateLinkResourceListResult { + /** The PrivateLinkResource items on this page */ + value: PrivateLinkResource[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _privateLinkResourceListResultDeserializer( + item: any, +): _PrivateLinkResourceListResult { + return { + value: privateLinkResourceArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function privateLinkResourceArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return privateLinkResourceDeserializer(item); + }); +} + +/** A private link resource. */ +export interface PrivateLinkResource extends Resource { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +export function privateLinkResourceDeserializer(item: any): PrivateLinkResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : privateLinkResourcePropertiesDeserializer(item["properties"]), + }; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + +export function privateLinkResourcePropertiesDeserializer( + item: any, +): PrivateLinkResourceProperties { + return { + groupId: item["groupId"], + requiredMembers: !item["requiredMembers"] + ? item["requiredMembers"] + : item["requiredMembers"].map((p: any) => { + return p; + }), + requiredZoneNames: !item["requiredZoneNames"] + ? item["requiredZoneNames"] + : item["requiredZoneNames"].map((p: any) => { + return p; + }), + }; +} + +/** A firewall rule on a redis cache has a name, and describes a contiguous range of IP addresses permitted to connect */ +export interface RedisFirewallRule extends ProxyResource { + /** redis cache firewall rule properties */ + properties: RedisFirewallRuleProperties; +} + +export function redisFirewallRuleSerializer(item: RedisFirewallRule): any { + return { + properties: redisFirewallRulePropertiesSerializer(item["properties"]), + }; +} + +export function redisFirewallRuleDeserializer(item: any): RedisFirewallRule { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: redisFirewallRulePropertiesDeserializer(item["properties"]), + }; +} + +/** Specifies a range of IP addresses permitted to connect to the cache */ +export interface RedisFirewallRuleProperties { + /** lowest IP address included in the range */ + startIP: string; + /** highest IP address included in the range */ + endIP: string; +} + +export function redisFirewallRulePropertiesSerializer(item: RedisFirewallRuleProperties): any { + return { startIP: item["startIP"], endIP: item["endIP"] }; +} + +export function redisFirewallRulePropertiesDeserializer(item: any): RedisFirewallRuleProperties { + return { + startIP: item["startIP"], + endIP: item["endIP"], + }; +} + +/** The response of a RedisFirewallRule list operation. */ +export interface _RedisFirewallRuleListResult { + /** The RedisFirewallRule items on this page */ + value: RedisFirewallRule[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisFirewallRuleListResultDeserializer(item: any): _RedisFirewallRuleListResult { + return { + value: redisFirewallRuleArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisFirewallRuleArraySerializer(result: Array): any[] { + return result.map((item) => { + return redisFirewallRuleSerializer(item); + }); +} + +export function redisFirewallRuleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return redisFirewallRuleDeserializer(item); + }); +} + +/** Response to put/get patch schedules for Redis cache. */ +export interface RedisPatchSchedule extends ProxyResource { + /** List of patch schedules for a Redis cache. */ + properties: ScheduleEntries; + /** The geo-location where the resource lives */ + readonly location?: string; +} + +export function redisPatchScheduleSerializer(item: RedisPatchSchedule): any { + return { properties: scheduleEntriesSerializer(item["properties"]) }; +} + +export function redisPatchScheduleDeserializer(item: any): RedisPatchSchedule { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: scheduleEntriesDeserializer(item["properties"]), + location: item["location"], + }; +} + +/** List of patch schedules for a Redis cache. */ +export interface ScheduleEntries { + /** List of patch schedules for a Redis cache. */ + scheduleEntries: ScheduleEntry[]; +} + +export function scheduleEntriesSerializer(item: ScheduleEntries): any { + return { + scheduleEntries: scheduleEntryArraySerializer(item["scheduleEntries"]), + }; +} + +export function scheduleEntriesDeserializer(item: any): ScheduleEntries { + return { + scheduleEntries: scheduleEntryArrayDeserializer(item["scheduleEntries"]), + }; +} + +export function scheduleEntryArraySerializer(result: Array): any[] { + return result.map((item) => { + return scheduleEntrySerializer(item); + }); +} + +export function scheduleEntryArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return scheduleEntryDeserializer(item); + }); +} + +/** Patch schedule entry for a Premium Redis Cache. */ +export interface ScheduleEntry { + /** Day of the week when a cache can be patched. */ + dayOfWeek: DayOfWeek; + /** Start hour after which cache patching can start. */ + startHourUtc: number; + /** ISO8601 timespan specifying how much time cache patching can take. */ + maintenanceWindow?: string; +} + +export function scheduleEntrySerializer(item: ScheduleEntry): any { + return { + dayOfWeek: item["dayOfWeek"], + startHourUtc: item["startHourUtc"], + maintenanceWindow: item["maintenanceWindow"], + }; +} + +export function scheduleEntryDeserializer(item: any): ScheduleEntry { + return { + dayOfWeek: item["dayOfWeek"], + startHourUtc: item["startHourUtc"], + maintenanceWindow: item["maintenanceWindow"], + }; +} + +/** Day of the week when a cache can be patched. */ +export type DayOfWeek = + | "Monday" + | "Tuesday" + | "Wednesday" + | "Thursday" + | "Friday" + | "Saturday" + | "Sunday" + | "Everyday" + | "Weekend"; + +/** The name of the resource that is the target of a particular operation. For singleton resources, it must be 'Default'. */ +export enum KnownDefaultName { + /** The name of e.g. the patch schedules resource, which is a singleton, must always be 'Default' */ + Default = "default", +} + +/** + * The name of the resource that is the target of a particular operation. For singleton resources, it must be 'Default'. \ + * {@link KnownDefaultName} can be used interchangeably with DefaultName, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **default**: The name of e.g. the patch schedules resource, which is a singleton, must always be 'Default' + */ +export type DefaultName = string; + +/** The response of a RedisPatchSchedule list operation. */ +export interface _RedisPatchScheduleListResult { + /** The RedisPatchSchedule items on this page */ + value: RedisPatchSchedule[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisPatchScheduleListResultDeserializer( + item: any, +): _RedisPatchScheduleListResult { + return { + value: redisPatchScheduleArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisPatchScheduleArraySerializer(result: Array): any[] { + return result.map((item) => { + return redisPatchScheduleSerializer(item); + }); +} + +export function redisPatchScheduleArrayDeserializer(result: Array): any[] { + return result.map((item) => { + return redisPatchScheduleDeserializer(item); + }); +} + +/** Response to get/put access policy. */ +export interface RedisCacheAccessPolicy extends ProxyResource { + /** Properties of an access policy. */ + properties?: RedisCacheAccessPolicyProperties; +} + +export function redisCacheAccessPolicySerializer(item: RedisCacheAccessPolicy): any { + return { + properties: !item["properties"] + ? item["properties"] + : redisCacheAccessPolicyPropertiesSerializer(item["properties"]), + }; +} + +export function redisCacheAccessPolicyDeserializer(item: any): RedisCacheAccessPolicy { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : redisCacheAccessPolicyPropertiesDeserializer(item["properties"]), + }; +} + +/** All properties of an access policy. */ +export interface RedisCacheAccessPolicyProperties { + /** Provisioning state of access policy */ + readonly provisioningState?: AccessPolicyProvisioningState; + /** Built-In or Custom access policy */ + readonly type?: AccessPolicyType; + /** Permissions for the access policy. Learn how to configure permissions at https://aka.ms/redis/AADPreRequisites */ + permissions: string; +} + +export function redisCacheAccessPolicyPropertiesSerializer( + item: RedisCacheAccessPolicyProperties, +): any { + return { permissions: item["permissions"] }; +} + +export function redisCacheAccessPolicyPropertiesDeserializer( + item: any, +): RedisCacheAccessPolicyProperties { + return { + provisioningState: item["provisioningState"], + type: item["type"], + permissions: item["permissions"], + }; +} + +/** Provisioning state of access policy */ +export enum KnownAccessPolicyProvisioningState { + /** An operation is in progress. */ + Updating = "Updating", + /** The operation succeeded. */ + Succeeded = "Succeeded", + /** A delete operation is in progress. */ + Deleting = "Deleting", + /** The access policy is considered deleted, if it still exists. */ + Deleted = "Deleted", + /** The operation was canceled. Access policies may be in a partially updated state. Update them again to have a well-defined state. */ + Canceled = "Canceled", + /** The operation failed. Access policies may be in a partially updated state. Update them again to have a well-defined state. */ + Failed = "Failed", +} + +/** + * Provisioning state of access policy \ + * {@link KnownAccessPolicyProvisioningState} can be used interchangeably with AccessPolicyProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating**: An operation is in progress. \ + * **Succeeded**: The operation succeeded. \ + * **Deleting**: A delete operation is in progress. \ + * **Deleted**: The access policy is considered deleted, if it still exists. \ + * **Canceled**: The operation was canceled. Access policies may be in a partially updated state. Update them again to have a well-defined state. \ + * **Failed**: The operation failed. Access policies may be in a partially updated state. Update them again to have a well-defined state. + */ +export type AccessPolicyProvisioningState = string; + +/** Built-In or Custom access policy */ +export enum KnownAccessPolicyType { + /** User-configurable access policy, using the redis access policy authoring language */ + Custom = "Custom", + /** Built-in or well-known access policies, whose policy is not configurable. */ + BuiltIn = "BuiltIn", +} + +/** + * Built-In or Custom access policy \ + * {@link KnownAccessPolicyType} can be used interchangeably with AccessPolicyType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Custom**: User-configurable access policy, using the redis access policy authoring language \ + * **BuiltIn**: Built-in or well-known access policies, whose policy is not configurable. + */ +export type AccessPolicyType = string; + +/** List of access policies (with properties) of a Redis cache. */ +export interface _RedisCacheAccessPolicyList { + /** The RedisCacheAccessPolicy items on this page */ + value: RedisCacheAccessPolicy[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisCacheAccessPolicyListDeserializer(item: any): _RedisCacheAccessPolicyList { + return { + value: redisCacheAccessPolicyArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisCacheAccessPolicyArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return redisCacheAccessPolicySerializer(item); + }); +} + +export function redisCacheAccessPolicyArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return redisCacheAccessPolicyDeserializer(item); + }); +} + +/** Response to an operation on access policy assignment */ +export interface RedisCacheAccessPolicyAssignment extends ProxyResource { + /** Properties of an access policy assignment */ + properties?: RedisCacheAccessPolicyAssignmentProperties; +} + +export function redisCacheAccessPolicyAssignmentSerializer( + item: RedisCacheAccessPolicyAssignment, +): any { + return { + properties: !item["properties"] + ? item["properties"] + : redisCacheAccessPolicyAssignmentPropertiesSerializer(item["properties"]), + }; +} + +export function redisCacheAccessPolicyAssignmentDeserializer( + item: any, +): RedisCacheAccessPolicyAssignment { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + properties: !item["properties"] + ? item["properties"] + : redisCacheAccessPolicyAssignmentPropertiesDeserializer(item["properties"]), + }; +} + +/** Properties for an access policy assignment */ +export interface RedisCacheAccessPolicyAssignmentProperties { + /** Provisioning state of an access policy assignment set */ + readonly provisioningState?: AccessPolicyAssignmentProvisioningState; + /** Object Id to assign access policy to */ + objectId: string; + /** User friendly name for object id. Also represents username for token based authentication */ + objectIdAlias: string; + /** The name of the access policy that is being assigned */ + accessPolicyName: string; +} + +export function redisCacheAccessPolicyAssignmentPropertiesSerializer( + item: RedisCacheAccessPolicyAssignmentProperties, +): any { + return { + objectId: item["objectId"], + objectIdAlias: item["objectIdAlias"], + accessPolicyName: item["accessPolicyName"], + }; +} + +export function redisCacheAccessPolicyAssignmentPropertiesDeserializer( + item: any, +): RedisCacheAccessPolicyAssignmentProperties { + return { + provisioningState: item["provisioningState"], + objectId: item["objectId"], + objectIdAlias: item["objectIdAlias"], + accessPolicyName: item["accessPolicyName"], + }; +} + +/** Provisioning state of an access policy assignment set */ +export enum KnownAccessPolicyAssignmentProvisioningState { + /** The access policy assignments are being updated */ + Updating = "Updating", + /** The access policy assignments were successfully updated */ + Succeeded = "Succeeded", + /** The access policy assignments are being deleted */ + Deleting = "Deleting", + /** The access policy assignments are considered deleted, meaning no custom access policies are applied. */ + Deleted = "Deleted", + /** The operation was canceled. Access policy assignments may be in a partially updated state. Update them again to have a well-defined state. */ + Canceled = "Canceled", + /** The operation failed. Access policy assignments may be in a partially updated state. Update them again to have a well-defined state. */ + Failed = "Failed", +} + +/** + * Provisioning state of an access policy assignment set \ + * {@link KnownAccessPolicyAssignmentProvisioningState} can be used interchangeably with AccessPolicyAssignmentProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Updating**: The access policy assignments are being updated \ + * **Succeeded**: The access policy assignments were successfully updated \ + * **Deleting**: The access policy assignments are being deleted \ + * **Deleted**: The access policy assignments are considered deleted, meaning no custom access policies are applied. \ + * **Canceled**: The operation was canceled. Access policy assignments may be in a partially updated state. Update them again to have a well-defined state. \ + * **Failed**: The operation failed. Access policy assignments may be in a partially updated state. Update them again to have a well-defined state. + */ +export type AccessPolicyAssignmentProvisioningState = string; + +/** List of access policies assignments (with properties) of a Redis cache. */ +export interface _RedisCacheAccessPolicyAssignmentList { + /** The RedisCacheAccessPolicyAssignment items on this page */ + value: RedisCacheAccessPolicyAssignment[]; + /** The link to the next page of items */ + nextLink?: string; +} + +export function _redisCacheAccessPolicyAssignmentListDeserializer( + item: any, +): _RedisCacheAccessPolicyAssignmentList { + return { + value: redisCacheAccessPolicyAssignmentArrayDeserializer(item["value"]), + nextLink: item["nextLink"], + }; +} + +export function redisCacheAccessPolicyAssignmentArraySerializer( + result: Array, +): any[] { + return result.map((item) => { + return redisCacheAccessPolicyAssignmentSerializer(item); + }); +} + +export function redisCacheAccessPolicyAssignmentArrayDeserializer( + result: Array, +): any[] { + return result.map((item) => { + return redisCacheAccessPolicyAssignmentDeserializer(item); + }); +} + +/** Asynchronous operation status */ +export interface OperationStatus extends OperationStatusResult { + /** Additional properties from RP, only when operation is successful */ + properties?: Record; +} + +export function operationStatusDeserializer(item: any): OperationStatus { + return { + id: item["id"], + name: item["name"], + status: item["status"], + percentComplete: item["percentComplete"], + startTime: !item["startTime"] ? item["startTime"] : new Date(item["startTime"]), + endTime: !item["endTime"] ? item["endTime"] : new Date(item["endTime"]), + operations: !item["operations"] + ? item["operations"] + : operationStatusResultArrayDeserializer(item["operations"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + properties: item["properties"], + }; +} + +/** The available API versions. */ +export enum KnownVersions { + /** The 2024-11-01 API version. */ + V20241101 = "2024-11-01", +} diff --git a/sdk/redis/arm-rediscache/src/models/parameters.ts b/sdk/redis/arm-rediscache/src/models/parameters.ts deleted file mode 100644 index 82d4cf354b5c..000000000000 --- a/sdk/redis/arm-rediscache/src/models/parameters.ts +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - OperationParameter, - OperationURLParameter, - OperationQueryParameter, -} from "@azure/core-client"; -import { - CheckNameAvailabilityParameters as CheckNameAvailabilityParametersMapper, - RedisCreateParameters as RedisCreateParametersMapper, - RedisUpdateParameters as RedisUpdateParametersMapper, - RedisRegenerateKeyParameters as RedisRegenerateKeyParametersMapper, - RedisRebootParameters as RedisRebootParametersMapper, - ImportRDBParameters as ImportRDBParametersMapper, - ExportRDBParameters as ExportRDBParametersMapper, - RedisFirewallRule as RedisFirewallRuleMapper, - RedisPatchSchedule as RedisPatchScheduleMapper, - RedisLinkedServerCreateParameters as RedisLinkedServerCreateParametersMapper, - PrivateEndpointConnection as PrivateEndpointConnectionMapper, - RedisCacheAccessPolicy as RedisCacheAccessPolicyMapper, - RedisCacheAccessPolicyAssignment as RedisCacheAccessPolicyAssignmentMapper, -} from "../models/mappers.js"; - -export const accept: OperationParameter = { - parameterPath: "accept", - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Accept", - type: { - name: "String", - }, - }, -}; - -export const $host: OperationURLParameter = { - parameterPath: "$host", - mapper: { - serializedName: "$host", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const apiVersion: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2024-11-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String", - }, - }, -}; - -export const nextLink: OperationURLParameter = { - parameterPath: "nextLink", - mapper: { - serializedName: "nextLink", - required: true, - type: { - name: "String", - }, - }, - skipEncoding: true, -}; - -export const contentType: OperationParameter = { - parameterPath: ["options", "contentType"], - mapper: { - defaultValue: "application/json", - isConstant: true, - serializedName: "Content-Type", - type: { - name: "String", - }, - }, -}; - -export const parameters: OperationParameter = { - parameterPath: "parameters", - mapper: CheckNameAvailabilityParametersMapper, -}; - -export const subscriptionId: OperationURLParameter = { - parameterPath: "subscriptionId", - mapper: { - constraints: { - MinLength: 1, - }, - serializedName: "subscriptionId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const resourceGroupName: OperationURLParameter = { - parameterPath: "resourceGroupName", - mapper: { - constraints: { - MaxLength: 90, - MinLength: 1, - }, - serializedName: "resourceGroupName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const name: OperationURLParameter = { - parameterPath: "name", - mapper: { - serializedName: "name", - required: true, - type: { - name: "String", - }, - }, -}; - -export const history: OperationQueryParameter = { - parameterPath: "history", - mapper: { - serializedName: "history", - required: true, - type: { - name: "Number", - }, - }, -}; - -export const parameters1: OperationParameter = { - parameterPath: "parameters", - mapper: RedisCreateParametersMapper, -}; - -export const parameters2: OperationParameter = { - parameterPath: "parameters", - mapper: RedisUpdateParametersMapper, -}; - -export const parameters3: OperationParameter = { - parameterPath: "parameters", - mapper: RedisRegenerateKeyParametersMapper, -}; - -export const parameters4: OperationParameter = { - parameterPath: "parameters", - mapper: RedisRebootParametersMapper, -}; - -export const parameters5: OperationParameter = { - parameterPath: "parameters", - mapper: ImportRDBParametersMapper, -}; - -export const parameters6: OperationParameter = { - parameterPath: "parameters", - mapper: ExportRDBParametersMapper, -}; - -export const cacheName: OperationURLParameter = { - parameterPath: "cacheName", - mapper: { - constraints: { - Pattern: new RegExp( - "^([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]|[a-zA-Z0-9])$", - ), - }, - serializedName: "cacheName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters7: OperationParameter = { - parameterPath: "parameters", - mapper: RedisFirewallRuleMapper, -}; - -export const ruleName: OperationURLParameter = { - parameterPath: "ruleName", - mapper: { - serializedName: "ruleName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters8: OperationParameter = { - parameterPath: "parameters", - mapper: RedisPatchScheduleMapper, -}; - -export const defaultParam: OperationURLParameter = { - parameterPath: "defaultParam", - mapper: { - serializedName: "default", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters9: OperationParameter = { - parameterPath: "parameters", - mapper: RedisLinkedServerCreateParametersMapper, -}; - -export const linkedServerName: OperationURLParameter = { - parameterPath: "linkedServerName", - mapper: { - serializedName: "linkedServerName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const privateEndpointConnectionName: OperationURLParameter = { - parameterPath: "privateEndpointConnectionName", - mapper: { - serializedName: "privateEndpointConnectionName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const properties: OperationParameter = { - parameterPath: "properties", - mapper: PrivateEndpointConnectionMapper, -}; - -export const location: OperationURLParameter = { - parameterPath: "location", - mapper: { - serializedName: "location", - required: true, - type: { - name: "String", - }, - }, -}; - -export const operationId: OperationURLParameter = { - parameterPath: "operationId", - mapper: { - serializedName: "operationId", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters10: OperationParameter = { - parameterPath: "parameters", - mapper: RedisCacheAccessPolicyMapper, -}; - -export const accessPolicyName: OperationURLParameter = { - parameterPath: "accessPolicyName", - mapper: { - constraints: { - Pattern: new RegExp( - "^([a-zA-Z0-9][a-zA-Z0-9- ]*[a-zA-Z0-9]|[a-zA-Z0-9])$", - ), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "accessPolicyName", - required: true, - type: { - name: "String", - }, - }, -}; - -export const parameters11: OperationParameter = { - parameterPath: "parameters", - mapper: RedisCacheAccessPolicyAssignmentMapper, -}; - -export const accessPolicyAssignmentName: OperationURLParameter = { - parameterPath: "accessPolicyAssignmentName", - mapper: { - constraints: { - Pattern: new RegExp( - "^([a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]|[a-zA-Z0-9])$", - ), - MaxLength: 63, - MinLength: 3, - }, - serializedName: "accessPolicyAssignmentName", - required: true, - type: { - name: "String", - }, - }, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts b/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts deleted file mode 100644 index 13ef25fc2941..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/accessPolicy.ts +++ /dev/null @@ -1,493 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { AccessPolicy } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - RedisCacheAccessPolicy, - AccessPolicyListNextOptionalParams, - AccessPolicyListOptionalParams, - AccessPolicyListResponse, - AccessPolicyCreateUpdateOptionalParams, - AccessPolicyCreateUpdateResponse, - AccessPolicyDeleteOptionalParams, - AccessPolicyGetOptionalParams, - AccessPolicyGetResponse, - AccessPolicyListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing AccessPolicy operations. */ -export class AccessPolicyImpl implements AccessPolicy { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class AccessPolicy class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets the list of access policies associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cacheName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AccessPolicyListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, cacheName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - cacheName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * Adds an access policy to the redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Update Access Policy operation. - * @param options The options parameters. - */ - async beginCreateUpdate( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - parameters: RedisCacheAccessPolicy, - options?: AccessPolicyCreateUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AccessPolicyCreateUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - cacheName, - accessPolicyName, - parameters, - options, - }, - spec: createUpdateOperationSpec, - }); - const poller = await createHttpPoller< - AccessPolicyCreateUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Adds an access policy to the redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Update Access Policy operation. - * @param options The options parameters. - */ - async beginCreateUpdateAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - parameters: RedisCacheAccessPolicy, - options?: AccessPolicyCreateUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdate( - resourceGroupName, - cacheName, - accessPolicyName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the access policy from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cacheName, accessPolicyName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the access policy from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - cacheName, - accessPolicyName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the detailed information about an access policy of a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, accessPolicyName, options }, - getOperationSpec, - ); - } - - /** - * Gets the list of access policies associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - cacheName: string, - nextLink: string, - options?: AccessPolicyListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicy, - }, - 201: { - bodyMapper: Mappers.RedisCacheAccessPolicy, - }, - 202: { - bodyMapper: Mappers.RedisCacheAccessPolicy, - }, - 204: { - bodyMapper: Mappers.RedisCacheAccessPolicy, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters10, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicy, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts b/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts deleted file mode 100644 index 10420df2289a..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/accessPolicyAssignment.ts +++ /dev/null @@ -1,498 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { AccessPolicyAssignment } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - RedisCacheAccessPolicyAssignment, - AccessPolicyAssignmentListNextOptionalParams, - AccessPolicyAssignmentListOptionalParams, - AccessPolicyAssignmentListResponse, - AccessPolicyAssignmentCreateUpdateOptionalParams, - AccessPolicyAssignmentCreateUpdateResponse, - AccessPolicyAssignmentDeleteOptionalParams, - AccessPolicyAssignmentGetOptionalParams, - AccessPolicyAssignmentGetResponse, - AccessPolicyAssignmentListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing AccessPolicyAssignment operations. */ -export class AccessPolicyAssignmentImpl implements AccessPolicyAssignment { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class AccessPolicyAssignment class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets the list of access policy assignments associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyAssignmentListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cacheName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyAssignmentListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: AccessPolicyAssignmentListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, cacheName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - cacheName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyAssignmentListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * Adds the access policy assignment to the specified users - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. - * @param options The options parameters. - */ - async beginCreateUpdate( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - parameters: RedisCacheAccessPolicyAssignment, - options?: AccessPolicyAssignmentCreateUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AccessPolicyAssignmentCreateUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - parameters, - options, - }, - spec: createUpdateOperationSpec, - }); - const poller = await createHttpPoller< - AccessPolicyAssignmentCreateUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Adds the access policy assignment to the specified users - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. - * @param options The options parameters. - */ - async beginCreateUpdateAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - parameters: RedisCacheAccessPolicyAssignment, - options?: AccessPolicyAssignmentCreateUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateUpdate( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the access policy assignment from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - options, - }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the access policy assignment from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - cacheName, - accessPolicyAssignmentName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the list of assignments for an access policy of a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, accessPolicyAssignmentName, options }, - getOperationSpec, - ); - } - - /** - * Gets the list of access policy assignments associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyAssignmentListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - cacheName: string, - nextLink: string, - options?: AccessPolicyAssignmentListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignment, - }, - 201: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignment, - }, - 202: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignment, - }, - 204: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignment, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters11, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyAssignmentName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyAssignmentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignment, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.accessPolicyAssignmentName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisCacheAccessPolicyAssignmentList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/asyncOperationStatus.ts b/sdk/redis/arm-rediscache/src/operations/asyncOperationStatus.ts deleted file mode 100644 index c16c9cc35dfd..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/asyncOperationStatus.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { AsyncOperationStatus } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - AsyncOperationStatusGetOptionalParams, - AsyncOperationStatusGetResponse, -} from "../models/index.js"; - -/** Class containing AsyncOperationStatus operations. */ -export class AsyncOperationStatusImpl implements AsyncOperationStatus { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class AsyncOperationStatus class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * For checking the ongoing status of an operation - * @param location The location at which operation was triggered - * @param operationId The ID of asynchronous operation - * @param options The options parameters. - */ - get( - location: string, - operationId: string, - options?: AsyncOperationStatusGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { location, operationId, options }, - getOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/asyncOperations/{operationId}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationStatus, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.location, - Parameters.operationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/firewallRules.ts b/sdk/redis/arm-rediscache/src/operations/firewallRules.ts deleted file mode 100644 index b78d9bf57a10..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/firewallRules.ts +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { FirewallRules } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - RedisFirewallRule, - FirewallRulesListNextOptionalParams, - FirewallRulesListOptionalParams, - FirewallRulesListResponse, - FirewallRulesCreateOrUpdateOptionalParams, - FirewallRulesCreateOrUpdateResponse, - FirewallRulesGetOptionalParams, - FirewallRulesGetResponse, - FirewallRulesDeleteOptionalParams, - FirewallRulesListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing FirewallRules operations. */ -export class FirewallRulesImpl implements FirewallRules { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class FirewallRules class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cacheName: string, - options?: FirewallRulesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cacheName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cacheName: string, - options?: FirewallRulesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: FirewallRulesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, cacheName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - cacheName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - cacheName: string, - options?: FirewallRulesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cacheName: string, - options?: FirewallRulesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listOperationSpec, - ); - } - - /** - * Create or update a redis cache firewall rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param parameters Parameters supplied to the create or update redis firewall rule operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - cacheName: string, - ruleName: string, - parameters: RedisFirewallRule, - options?: FirewallRulesCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, ruleName, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Gets a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - ruleName: string, - options?: FirewallRulesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, ruleName, options }, - getOperationSpec, - ); - } - - /** - * Deletes a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - cacheName: string, - ruleName: string, - options?: FirewallRulesDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, ruleName, options }, - deleteOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - cacheName: string, - nextLink: string, - options?: FirewallRulesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisFirewallRuleListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisFirewallRule, - }, - 201: { - bodyMapper: Mappers.RedisFirewallRule, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters7, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisFirewallRule, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/firewallRules/{ruleName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.ruleName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisFirewallRuleListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/index.ts b/sdk/redis/arm-rediscache/src/operations/index.ts deleted file mode 100644 index d312be97558a..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations.js"; -export * from "./redis.js"; -export * from "./firewallRules.js"; -export * from "./patchSchedules.js"; -export * from "./linkedServer.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./asyncOperationStatus.js"; -export * from "./accessPolicy.js"; -export * from "./accessPolicyAssignment.js"; diff --git a/sdk/redis/arm-rediscache/src/operations/linkedServer.ts b/sdk/redis/arm-rediscache/src/operations/linkedServer.ts deleted file mode 100644 index 67d9d4bfa045..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/linkedServer.ts +++ /dev/null @@ -1,482 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { LinkedServer } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - RedisLinkedServerWithProperties, - LinkedServerListNextOptionalParams, - LinkedServerListOptionalParams, - LinkedServerListResponse, - RedisLinkedServerCreateParameters, - LinkedServerCreateOptionalParams, - LinkedServerCreateResponse, - LinkedServerDeleteOptionalParams, - LinkedServerGetOptionalParams, - LinkedServerGetResponse, - LinkedServerListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing LinkedServer operations. */ -export class LinkedServerImpl implements LinkedServer { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class LinkedServer class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - name: string, - options?: LinkedServerListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, name, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(resourceGroupName, name, options, settings); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - name: string, - options?: LinkedServerListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: LinkedServerListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(resourceGroupName, name, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - resourceGroupName, - name, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - resourceGroupName: string, - name: string, - options?: LinkedServerListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - name, - options, - )) { - yield* page; - } - } - - /** - * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Linked server operation. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - name: string, - linkedServerName: string, - parameters: RedisLinkedServerCreateParameters, - options?: LinkedServerCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LinkedServerCreateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, linkedServerName, parameters, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - LinkedServerCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Linked server operation. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - name: string, - linkedServerName: string, - parameters: RedisLinkedServerCreateParameters, - options?: LinkedServerCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - name, - linkedServerName, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, linkedServerName, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete( - resourceGroupName, - name, - linkedServerName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, linkedServerName, options }, - getOperationSpec, - ); - } - - /** - * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - name: string, - options?: LinkedServerListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, options }, - listOperationSpec, - ); - } - - /** - * ListNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - resourceGroupName: string, - name: string, - nextLink: string, - options?: LinkedServerListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisLinkedServerWithProperties, - }, - 201: { - bodyMapper: Mappers.RedisLinkedServerWithProperties, - }, - 202: { - bodyMapper: Mappers.RedisLinkedServerWithProperties, - }, - 204: { - bodyMapper: Mappers.RedisLinkedServerWithProperties, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters9, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.linkedServerName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.linkedServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisLinkedServerWithProperties, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.linkedServerName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisLinkedServerWithPropertiesList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisLinkedServerWithPropertiesList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/operations.ts b/sdk/redis/arm-rediscache/src/operations/operations.ts deleted file mode 100644 index 593fdd000c65..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/operations.ts +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Operations } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - Operation, - OperationsListNextOptionalParams, - OperationsListOptionalParams, - OperationsListResponse, - OperationsListNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Operations operations. */ -export class OperationsImpl implements Operations { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class Operations class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. - * @param options The options parameters. - */ - public list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(options, settings); - }, - }; - } - - private async *listPagingPage( - options?: OperationsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: OperationsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - options?: OperationsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage(options)) { - yield* page; - } - } - - /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. - * @param options The options parameters. - */ - private _list( - options?: OperationsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest({ options }, listOperationSpec); - } - - /** - * ListNext - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - nextLink: string, - options?: OperationsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Cache/operations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.OperationListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [Parameters.$host, Parameters.nextLink], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts deleted file mode 100644 index d1968b777a9b..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/patchSchedules.ts +++ /dev/null @@ -1,336 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { PatchSchedules } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - RedisPatchSchedule, - PatchSchedulesListByRedisResourceNextOptionalParams, - PatchSchedulesListByRedisResourceOptionalParams, - PatchSchedulesListByRedisResourceResponse, - DefaultName, - PatchSchedulesCreateOrUpdateOptionalParams, - PatchSchedulesCreateOrUpdateResponse, - PatchSchedulesDeleteOptionalParams, - PatchSchedulesGetOptionalParams, - PatchSchedulesGetResponse, - PatchSchedulesListByRedisResourceNextResponse, -} from "../models/index.js"; - -/// -/** Class containing PatchSchedules operations. */ -export class PatchSchedulesImpl implements PatchSchedules { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class PatchSchedules class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public listByRedisResource( - resourceGroupName: string, - cacheName: string, - options?: PatchSchedulesListByRedisResourceOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByRedisResourcePagingAll( - resourceGroupName, - cacheName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByRedisResourcePagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listByRedisResourcePagingPage( - resourceGroupName: string, - cacheName: string, - options?: PatchSchedulesListByRedisResourceOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: PatchSchedulesListByRedisResourceResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByRedisResource( - resourceGroupName, - cacheName, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByRedisResourceNext( - resourceGroupName, - cacheName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByRedisResourcePagingAll( - resourceGroupName: string, - cacheName: string, - options?: PatchSchedulesListByRedisResourceOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByRedisResourcePagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _listByRedisResource( - resourceGroupName: string, - cacheName: string, - options?: PatchSchedulesListByRedisResourceOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listByRedisResourceOperationSpec, - ); - } - - /** - * Create or replace the patching schedule for Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param parameters Parameters to set the patching schedule for Redis cache. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - parameters: RedisPatchSchedule, - options?: PatchSchedulesCreateOrUpdateOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, defaultParam, parameters, options }, - createOrUpdateOperationSpec, - ); - } - - /** - * Deletes the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - options?: PatchSchedulesDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, defaultParam, options }, - deleteOperationSpec, - ); - } - - /** - * Gets the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - options?: PatchSchedulesGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, defaultParam, options }, - getOperationSpec, - ); - } - - /** - * ListByRedisResourceNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param nextLink The nextLink from the previous successful call to the ListByRedisResource method. - * @param options The options parameters. - */ - private _listByRedisResourceNext( - resourceGroupName: string, - cacheName: string, - nextLink: string, - options?: PatchSchedulesListByRedisResourceNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, nextLink, options }, - listByRedisResourceNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByRedisResourceOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/patchSchedules", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisPatchScheduleListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisPatchSchedule, - }, - 201: { - bodyMapper: Mappers.RedisPatchSchedule, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters8, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.defaultParam, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.defaultParam, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/patchSchedules/{default}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisPatchSchedule, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - Parameters.defaultParam, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByRedisResourceNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisPatchScheduleListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts b/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts deleted file mode 100644 index bcedb7df355a..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/privateEndpointConnections.ts +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateEndpointConnections } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsListResponse, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsPutOptionalParams, - PrivateEndpointConnectionsPutResponse, - PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Class containing PrivateEndpointConnections operations. */ -export class PrivateEndpointConnectionsImpl - implements PrivateEndpointConnections -{ - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class PrivateEndpointConnections class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public list( - resourceGroupName: string, - cacheName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(resourceGroupName, cacheName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - resourceGroupName: string, - cacheName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateEndpointConnectionsListResponse; - result = await this._list(resourceGroupName, cacheName, options); - yield result.value || []; - } - - private async *listPagingAll( - resourceGroupName: string, - cacheName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _list( - resourceGroupName: string, - cacheName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listOperationSpec, - ); - } - - /** - * Gets the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, privateEndpointConnectionName, options }, - getOperationSpec, - ); - } - - /** - * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - async beginPut( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsPutOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsPutResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - resourceGroupName, - cacheName, - privateEndpointConnectionName, - properties, - options, - }, - spec: putOperationSpec, - }); - const poller = await createHttpPoller< - PrivateEndpointConnectionsPutResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - async beginPutAndWait( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsPutOptionalParams, - ): Promise { - const poller = await this.beginPut( - resourceGroupName, - cacheName, - privateEndpointConnectionName, - properties, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, privateEndpointConnectionName, options }, - deleteOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnectionListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const putOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 201: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 202: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - 204: { - bodyMapper: Mappers.PrivateEndpointConnection, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.properties, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}", - httpMethod: "DELETE", - responses: { - 200: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - Parameters.privateEndpointConnectionName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts b/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts deleted file mode 100644 index 9b4653f04e26..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/privateLinkResources.ts +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { PrivateLinkResources } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - PrivateLinkResource, - PrivateLinkResourcesListByRedisCacheOptionalParams, - PrivateLinkResourcesListByRedisCacheResponse, -} from "../models/index.js"; - -/// -/** Class containing PrivateLinkResources operations. */ -export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class PrivateLinkResources class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - public listByRedisCache( - resourceGroupName: string, - cacheName: string, - options?: PrivateLinkResourcesListByRedisCacheOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByRedisCachePagingAll( - resourceGroupName, - cacheName, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByRedisCachePagingPage( - resourceGroupName, - cacheName, - options, - settings, - ); - }, - }; - } - - private async *listByRedisCachePagingPage( - resourceGroupName: string, - cacheName: string, - options?: PrivateLinkResourcesListByRedisCacheOptionalParams, - _settings?: PageSettings, - ): AsyncIterableIterator { - let result: PrivateLinkResourcesListByRedisCacheResponse; - result = await this._listByRedisCache( - resourceGroupName, - cacheName, - options, - ); - yield result.value || []; - } - - private async *listByRedisCachePagingAll( - resourceGroupName: string, - cacheName: string, - options?: PrivateLinkResourcesListByRedisCacheOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByRedisCachePagingPage( - resourceGroupName, - cacheName, - options, - )) { - yield* page; - } - } - - /** - * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - private _listByRedisCache( - resourceGroupName: string, - cacheName: string, - options?: PrivateLinkResourcesListByRedisCacheOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, cacheName, options }, - listByRedisCacheOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listByRedisCacheOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateLinkResources", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.PrivateLinkResourceListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operations/redis.ts b/sdk/redis/arm-rediscache/src/operations/redis.ts deleted file mode 100644 index 904693dd3b35..000000000000 --- a/sdk/redis/arm-rediscache/src/operations/redis.ts +++ /dev/null @@ -1,1394 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper.js"; -import { Redis } from "../operationsInterfaces/index.js"; -import * as coreClient from "@azure/core-client"; -import * as Mappers from "../models/mappers.js"; -import * as Parameters from "../models/parameters.js"; -import { RedisManagementClient } from "../redisManagementClient.js"; -import { - SimplePollerLike, - OperationState, - createHttpPoller, -} from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl.js"; -import { - UpgradeNotification, - RedisListUpgradeNotificationsNextOptionalParams, - RedisListUpgradeNotificationsOptionalParams, - RedisListUpgradeNotificationsResponse, - RedisResource, - RedisListByResourceGroupNextOptionalParams, - RedisListByResourceGroupOptionalParams, - RedisListByResourceGroupResponse, - RedisListBySubscriptionNextOptionalParams, - RedisListBySubscriptionOptionalParams, - RedisListBySubscriptionResponse, - CheckNameAvailabilityParameters, - RedisCheckNameAvailabilityOptionalParams, - RedisCreateParameters, - RedisCreateOptionalParams, - RedisCreateResponse, - RedisUpdateParameters, - RedisUpdateOptionalParams, - RedisUpdateResponse, - RedisDeleteOptionalParams, - RedisGetOptionalParams, - RedisGetResponse, - RedisListKeysOptionalParams, - RedisListKeysResponse, - RedisRegenerateKeyParameters, - RedisRegenerateKeyOptionalParams, - RedisRegenerateKeyResponse, - RedisRebootParameters, - RedisForceRebootOptionalParams, - RedisForceRebootOperationResponse, - ImportRDBParameters, - RedisImportDataOptionalParams, - ExportRDBParameters, - RedisExportDataOptionalParams, - RedisFlushCacheOptionalParams, - RedisFlushCacheResponse, - RedisListUpgradeNotificationsNextResponse, - RedisListByResourceGroupNextResponse, - RedisListBySubscriptionNextResponse, -} from "../models/index.js"; - -/// -/** Class containing Redis operations. */ -export class RedisImpl implements Redis { - private readonly client: RedisManagementClient; - - /** - * Initialize a new instance of the class Redis class. - * @param client Reference to the service client - */ - constructor(client: RedisManagementClient) { - this.client = client; - } - - /** - * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications - * @param options The options parameters. - */ - public listUpgradeNotifications( - resourceGroupName: string, - name: string, - history: number, - options?: RedisListUpgradeNotificationsOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listUpgradeNotificationsPagingAll( - resourceGroupName, - name, - history, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listUpgradeNotificationsPagingPage( - resourceGroupName, - name, - history, - options, - settings, - ); - }, - }; - } - - private async *listUpgradeNotificationsPagingPage( - resourceGroupName: string, - name: string, - history: number, - options?: RedisListUpgradeNotificationsOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: RedisListUpgradeNotificationsResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listUpgradeNotifications( - resourceGroupName, - name, - history, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listUpgradeNotificationsNext( - resourceGroupName, - name, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listUpgradeNotificationsPagingAll( - resourceGroupName: string, - name: string, - history: number, - options?: RedisListUpgradeNotificationsOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listUpgradeNotificationsPagingPage( - resourceGroupName, - name, - history, - options, - )) { - yield* page; - } - } - - /** - * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - public listByResourceGroup( - resourceGroupName: string, - options?: RedisListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listByResourceGroupPagingAll(resourceGroupName, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listByResourceGroupPagingPage( - resourceGroupName, - options, - settings, - ); - }, - }; - } - - private async *listByResourceGroupPagingPage( - resourceGroupName: string, - options?: RedisListByResourceGroupOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: RedisListByResourceGroupResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listByResourceGroup(resourceGroupName, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listByResourceGroupNext( - resourceGroupName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listByResourceGroupPagingAll( - resourceGroupName: string, - options?: RedisListByResourceGroupOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listByResourceGroupPagingPage( - resourceGroupName, - options, - )) { - yield* page; - } - } - - /** - * Gets all Redis caches in the specified subscription. - * @param options The options parameters. - */ - public listBySubscription( - options?: RedisListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listBySubscriptionPagingAll(options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listBySubscriptionPagingPage(options, settings); - }, - }; - } - - private async *listBySubscriptionPagingPage( - options?: RedisListBySubscriptionOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: RedisListBySubscriptionResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._listBySubscription(options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listBySubscriptionNext(continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listBySubscriptionPagingAll( - options?: RedisListBySubscriptionOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listBySubscriptionPagingPage(options)) { - yield* page; - } - } - - /** - * Checks that the redis cache name is valid and is not already in use. - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only - * supported resource type is 'Microsoft.Cache/redis' - * @param options The options parameters. - */ - checkNameAvailability( - parameters: CheckNameAvailabilityParameters, - options?: RedisCheckNameAvailabilityOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { parameters, options }, - checkNameAvailabilityOperationSpec, - ); - } - - /** - * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications - * @param options The options parameters. - */ - private _listUpgradeNotifications( - resourceGroupName: string, - name: string, - history: number, - options?: RedisListUpgradeNotificationsOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, history, options }, - listUpgradeNotificationsOperationSpec, - ); - } - - /** - * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Create Redis operation. - * @param options The options parameters. - */ - async beginCreate( - resourceGroupName: string, - name: string, - parameters: RedisCreateParameters, - options?: RedisCreateOptionalParams, - ): Promise< - SimplePollerLike, RedisCreateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, parameters, options }, - spec: createOperationSpec, - }); - const poller = await createHttpPoller< - RedisCreateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Create Redis operation. - * @param options The options parameters. - */ - async beginCreateAndWait( - resourceGroupName: string, - name: string, - parameters: RedisCreateParameters, - options?: RedisCreateOptionalParams, - ): Promise { - const poller = await this.beginCreate( - resourceGroupName, - name, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Update Redis operation. - * @param options The options parameters. - */ - async beginUpdate( - resourceGroupName: string, - name: string, - parameters: RedisUpdateParameters, - options?: RedisUpdateOptionalParams, - ): Promise< - SimplePollerLike, RedisUpdateResponse> - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, parameters, options }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - RedisUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Update Redis operation. - * @param options The options parameters. - */ - async beginUpdateAndWait( - resourceGroupName: string, - name: string, - parameters: RedisUpdateParameters, - options?: RedisUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - resourceGroupName, - name, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - async beginDelete( - resourceGroupName: string, - name: string, - options?: RedisDeleteOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, options }, - spec: deleteOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - async beginDeleteAndWait( - resourceGroupName: string, - name: string, - options?: RedisDeleteOptionalParams, - ): Promise { - const poller = await this.beginDelete(resourceGroupName, name, options); - return poller.pollUntilDone(); - } - - /** - * Gets a Redis cache (resource description). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - options?: RedisGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, options }, - getOperationSpec, - ); - } - - /** - * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - private _listByResourceGroup( - resourceGroupName: string, - options?: RedisListByResourceGroupOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, options }, - listByResourceGroupOperationSpec, - ); - } - - /** - * Gets all Redis caches in the specified subscription. - * @param options The options parameters. - */ - private _listBySubscription( - options?: RedisListBySubscriptionOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { options }, - listBySubscriptionOperationSpec, - ); - } - - /** - * Retrieve a Redis cache's access keys. This operation requires write permission to the cache - * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - listKeys( - resourceGroupName: string, - name: string, - options?: RedisListKeysOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, options }, - listKeysOperationSpec, - ); - } - - /** - * Regenerate Redis cache's access keys. This operation requires write permission to the cache - * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Specifies which key to regenerate. - * @param options The options parameters. - */ - regenerateKey( - resourceGroupName: string, - name: string, - parameters: RedisRegenerateKeyParameters, - options?: RedisRegenerateKeyOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, parameters, options }, - regenerateKeyOperationSpec, - ); - } - - /** - * Reboot specified Redis node(s). This operation requires write permission to the cache resource. - * There can be potential data loss. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Specifies which Redis node(s) to reboot. - * @param options The options parameters. - */ - forceReboot( - resourceGroupName: string, - name: string, - parameters: RedisRebootParameters, - options?: RedisForceRebootOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, parameters, options }, - forceRebootOperationSpec, - ); - } - - /** - * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis import operation. - * @param options The options parameters. - */ - async beginImportData( - resourceGroupName: string, - name: string, - parameters: ImportRDBParameters, - options?: RedisImportDataOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, parameters, options }, - spec: importDataOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis import operation. - * @param options The options parameters. - */ - async beginImportDataAndWait( - resourceGroupName: string, - name: string, - parameters: ImportRDBParameters, - options?: RedisImportDataOptionalParams, - ): Promise { - const poller = await this.beginImportData( - resourceGroupName, - name, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis export operation. - * @param options The options parameters. - */ - async beginExportData( - resourceGroupName: string, - name: string, - parameters: ExportRDBParameters, - options?: RedisExportDataOptionalParams, - ): Promise, void>> { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, name, parameters, options }, - spec: exportDataOperationSpec, - }); - const poller = await createHttpPoller>(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis export operation. - * @param options The options parameters. - */ - async beginExportDataAndWait( - resourceGroupName: string, - name: string, - parameters: ExportRDBParameters, - options?: RedisExportDataOptionalParams, - ): Promise { - const poller = await this.beginExportData( - resourceGroupName, - name, - parameters, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Deletes all of the keys in a cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - async beginFlushCache( - resourceGroupName: string, - cacheName: string, - options?: RedisFlushCacheOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - RedisFlushCacheResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = - undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { resourceGroupName, cacheName, options }, - spec: flushCacheOperationSpec, - }); - const poller = await createHttpPoller< - RedisFlushCacheResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Deletes all of the keys in a cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - async beginFlushCacheAndWait( - resourceGroupName: string, - cacheName: string, - options?: RedisFlushCacheOptionalParams, - ): Promise { - const poller = await this.beginFlushCache( - resourceGroupName, - cacheName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * ListUpgradeNotificationsNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param nextLink The nextLink from the previous successful call to the ListUpgradeNotifications - * method. - * @param options The options parameters. - */ - private _listUpgradeNotificationsNext( - resourceGroupName: string, - name: string, - nextLink: string, - options?: RedisListUpgradeNotificationsNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, name, nextLink, options }, - listUpgradeNotificationsNextOperationSpec, - ); - } - - /** - * ListByResourceGroupNext - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method. - * @param options The options parameters. - */ - private _listByResourceGroupNext( - resourceGroupName: string, - nextLink: string, - options?: RedisListByResourceGroupNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { resourceGroupName, nextLink, options }, - listByResourceGroupNextOperationSpec, - ); - } - - /** - * ListBySubscriptionNext - * @param nextLink The nextLink from the previous successful call to the ListBySubscription method. - * @param options The options parameters. - */ - private _listBySubscriptionNext( - nextLink: string, - options?: RedisListBySubscriptionNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { nextLink, options }, - listBySubscriptionNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/CheckNameAvailability", - httpMethod: "POST", - responses: { - 200: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const listUpgradeNotificationsOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listUpgradeNotifications", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NotificationListResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.history], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const createOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.RedisResource, - }, - 201: { - bodyMapper: Mappers.RedisResource, - }, - 202: { - bodyMapper: Mappers.RedisResource, - }, - 204: { - bodyMapper: Mappers.RedisResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.RedisResource, - }, - 201: { - bodyMapper: Mappers.RedisResource, - }, - 202: { - bodyMapper: Mappers.RedisResource, - }, - 204: { - bodyMapper: Mappers.RedisResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const deleteOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}", - httpMethod: "DELETE", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisResource, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/redis", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.subscriptionId], - headerParameters: [Parameters.accept], - serializer, -}; -const listKeysOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/listKeys", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RedisAccessKeys, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const regenerateKeyOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/regenerateKey", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RedisAccessKeys, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const forceRebootOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/forceReboot", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.RedisForceRebootResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const importDataOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/import", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const exportDataOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/export", - httpMethod: "POST", - responses: { - 200: {}, - 201: {}, - 202: {}, - 204: {}, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept, Parameters.contentType], - mediaType: "json", - serializer, -}; -const flushCacheOperationSpec: coreClient.OperationSpec = { - path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/flush", - httpMethod: "POST", - responses: { - 200: { - bodyMapper: Mappers.OperationStatusResult, - headersMapper: Mappers.RedisFlushCacheHeaders, - }, - 201: { - bodyMapper: Mappers.OperationStatusResult, - headersMapper: Mappers.RedisFlushCacheHeaders, - }, - 202: { - bodyMapper: Mappers.OperationStatusResult, - headersMapper: Mappers.RedisFlushCacheHeaders, - }, - 204: { - bodyMapper: Mappers.OperationStatusResult, - headersMapper: Mappers.RedisFlushCacheHeaders, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.cacheName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listUpgradeNotificationsNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.NotificationListResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - Parameters.name, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - Parameters.resourceGroupName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.RedisListResult, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.nextLink, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts deleted file mode 100644 index ac2d924f7842..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicy.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - RedisCacheAccessPolicy, - AccessPolicyListOptionalParams, - AccessPolicyCreateUpdateOptionalParams, - AccessPolicyCreateUpdateResponse, - AccessPolicyDeleteOptionalParams, - AccessPolicyGetOptionalParams, - AccessPolicyGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AccessPolicy. */ -export interface AccessPolicy { - /** - * Gets the list of access policies associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Adds an access policy to the redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Update Access Policy operation. - * @param options The options parameters. - */ - beginCreateUpdate( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - parameters: RedisCacheAccessPolicy, - options?: AccessPolicyCreateUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AccessPolicyCreateUpdateResponse - > - >; - /** - * Adds an access policy to the redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Update Access Policy operation. - * @param options The options parameters. - */ - beginCreateUpdateAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - parameters: RedisCacheAccessPolicy, - options?: AccessPolicyCreateUpdateOptionalParams, - ): Promise; - /** - * Deletes the access policy from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the access policy from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyDeleteOptionalParams, - ): Promise; - /** - * Gets the detailed information about an access policy of a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyName The name of the access policy that is being added to the Redis cache. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - accessPolicyName: string, - options?: AccessPolicyGetOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts deleted file mode 100644 index d425922ff22f..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/accessPolicyAssignment.ts +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - RedisCacheAccessPolicyAssignment, - AccessPolicyAssignmentListOptionalParams, - AccessPolicyAssignmentCreateUpdateOptionalParams, - AccessPolicyAssignmentCreateUpdateResponse, - AccessPolicyAssignmentDeleteOptionalParams, - AccessPolicyAssignmentGetOptionalParams, - AccessPolicyAssignmentGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a AccessPolicyAssignment. */ -export interface AccessPolicyAssignment { - /** - * Gets the list of access policy assignments associated with this redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cacheName: string, - options?: AccessPolicyAssignmentListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Adds the access policy assignment to the specified users - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. - * @param options The options parameters. - */ - beginCreateUpdate( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - parameters: RedisCacheAccessPolicyAssignment, - options?: AccessPolicyAssignmentCreateUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - AccessPolicyAssignmentCreateUpdateResponse - > - >; - /** - * Adds the access policy assignment to the specified users - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param parameters Parameters supplied to the Create Update Access Policy Assignment operation. - * @param options The options parameters. - */ - beginCreateUpdateAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - parameters: RedisCacheAccessPolicyAssignment, - options?: AccessPolicyAssignmentCreateUpdateOptionalParams, - ): Promise; - /** - * Deletes the access policy assignment from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the access policy assignment from a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentDeleteOptionalParams, - ): Promise; - /** - * Gets the list of assignments for an access policy of a redis cache - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param accessPolicyAssignmentName The name of the access policy assignment. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - accessPolicyAssignmentName: string, - options?: AccessPolicyAssignmentGetOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/asyncOperationStatus.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/asyncOperationStatus.ts deleted file mode 100644 index 29a125ef0284..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/asyncOperationStatus.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { - AsyncOperationStatusGetOptionalParams, - AsyncOperationStatusGetResponse, -} from "../models/index.js"; - -/** Interface representing a AsyncOperationStatus. */ -export interface AsyncOperationStatus { - /** - * For checking the ongoing status of an operation - * @param location The location at which operation was triggered - * @param operationId The ID of asynchronous operation - * @param options The options parameters. - */ - get( - location: string, - operationId: string, - options?: AsyncOperationStatusGetOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts deleted file mode 100644 index c483ba9563ef..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/firewallRules.ts +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RedisFirewallRule, - FirewallRulesListOptionalParams, - FirewallRulesCreateOrUpdateOptionalParams, - FirewallRulesCreateOrUpdateResponse, - FirewallRulesGetOptionalParams, - FirewallRulesGetResponse, - FirewallRulesDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a FirewallRules. */ -export interface FirewallRules { - /** - * Gets all firewall rules in the specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cacheName: string, - options?: FirewallRulesListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create or update a redis cache firewall rule - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param parameters Parameters supplied to the create or update redis firewall rule operation. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - cacheName: string, - ruleName: string, - parameters: RedisFirewallRule, - options?: FirewallRulesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Gets a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - ruleName: string, - options?: FirewallRulesGetOptionalParams, - ): Promise; - /** - * Deletes a single firewall rule in a specified redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param ruleName The name of the firewall rule. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - cacheName: string, - ruleName: string, - options?: FirewallRulesDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts deleted file mode 100644 index d312be97558a..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export * from "./operations.js"; -export * from "./redis.js"; -export * from "./firewallRules.js"; -export * from "./patchSchedules.js"; -export * from "./linkedServer.js"; -export * from "./privateEndpointConnections.js"; -export * from "./privateLinkResources.js"; -export * from "./asyncOperationStatus.js"; -export * from "./accessPolicy.js"; -export * from "./accessPolicyAssignment.js"; diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts deleted file mode 100644 index aab50484bde1..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/linkedServer.ts +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - RedisLinkedServerWithProperties, - LinkedServerListOptionalParams, - RedisLinkedServerCreateParameters, - LinkedServerCreateOptionalParams, - LinkedServerCreateResponse, - LinkedServerDeleteOptionalParams, - LinkedServerGetOptionalParams, - LinkedServerGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a LinkedServer. */ -export interface LinkedServer { - /** - * Gets the list of linked servers associated with this redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - name: string, - options?: LinkedServerListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Linked server operation. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - name: string, - linkedServerName: string, - parameters: RedisLinkedServerCreateParameters, - options?: LinkedServerCreateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - LinkedServerCreateResponse - > - >; - /** - * Adds a linked server to the Redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param parameters Parameters supplied to the Create Linked server operation. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - name: string, - linkedServerName: string, - parameters: RedisLinkedServerCreateParameters, - options?: LinkedServerCreateOptionalParams, - ): Promise; - /** - * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes the linked server from a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server that is being added to the Redis cache. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerDeleteOptionalParams, - ): Promise; - /** - * Gets the detailed information about a linked server of a redis cache (requires Premium SKU). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param linkedServerName The name of the linked server. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - linkedServerName: string, - options?: LinkedServerGetOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/operations.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/operations.ts deleted file mode 100644 index 14ed735d341a..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/operations.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { Operation, OperationsListOptionalParams } from "../models/index.js"; - -/// -/** Interface representing a Operations. */ -export interface Operations { - /** - * Lists all of the available REST API operations of the Microsoft.Cache provider. - * @param options The options parameters. - */ - list( - options?: OperationsListOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts deleted file mode 100644 index c8c02e7208f7..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/patchSchedules.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - RedisPatchSchedule, - PatchSchedulesListByRedisResourceOptionalParams, - DefaultName, - PatchSchedulesCreateOrUpdateOptionalParams, - PatchSchedulesCreateOrUpdateResponse, - PatchSchedulesDeleteOptionalParams, - PatchSchedulesGetOptionalParams, - PatchSchedulesGetResponse, -} from "../models/index.js"; - -/// -/** Interface representing a PatchSchedules. */ -export interface PatchSchedules { - /** - * Gets all patch schedules in the specified redis cache (there is only one). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - listByRedisResource( - resourceGroupName: string, - cacheName: string, - options?: PatchSchedulesListByRedisResourceOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Create or replace the patching schedule for Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param parameters Parameters to set the patching schedule for Redis cache. - * @param options The options parameters. - */ - createOrUpdate( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - parameters: RedisPatchSchedule, - options?: PatchSchedulesCreateOrUpdateOptionalParams, - ): Promise; - /** - * Deletes the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - options?: PatchSchedulesDeleteOptionalParams, - ): Promise; - /** - * Gets the patching schedule of a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the redis cache. - * @param defaultParam Default string modeled as parameter for auto generation to work correctly. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - defaultParam: DefaultName, - options?: PatchSchedulesGetOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts deleted file mode 100644 index 6c193a9479e2..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateEndpointConnections.ts +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - PrivateEndpointConnection, - PrivateEndpointConnectionsListOptionalParams, - PrivateEndpointConnectionsGetOptionalParams, - PrivateEndpointConnectionsGetResponse, - PrivateEndpointConnectionsPutOptionalParams, - PrivateEndpointConnectionsPutResponse, - PrivateEndpointConnectionsDeleteOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateEndpointConnections. */ -export interface PrivateEndpointConnections { - /** - * List all the private endpoint connections associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - list( - resourceGroupName: string, - cacheName: string, - options?: PrivateEndpointConnectionsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - get( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsGetOptionalParams, - ): Promise; - /** - * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - beginPut( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsPutOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - PrivateEndpointConnectionsPutResponse - > - >; - /** - * Update the state of specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param properties The private endpoint connection properties. - * @param options The options parameters. - */ - beginPutAndWait( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - properties: PrivateEndpointConnection, - options?: PrivateEndpointConnectionsPutOptionalParams, - ): Promise; - /** - * Deletes the specified private endpoint connection associated with the redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param privateEndpointConnectionName The name of the private endpoint connection associated with the - * Azure resource - * @param options The options parameters. - */ - delete( - resourceGroupName: string, - cacheName: string, - privateEndpointConnectionName: string, - options?: PrivateEndpointConnectionsDeleteOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts deleted file mode 100644 index 29dfb1bfc07e..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/privateLinkResources.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { - PrivateLinkResource, - PrivateLinkResourcesListByRedisCacheOptionalParams, -} from "../models/index.js"; - -/// -/** Interface representing a PrivateLinkResources. */ -export interface PrivateLinkResources { - /** - * Gets the private link resources that need to be created for a redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - listByRedisCache( - resourceGroupName: string, - cacheName: string, - options?: PrivateLinkResourcesListByRedisCacheOptionalParams, - ): PagedAsyncIterableIterator; -} diff --git a/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts b/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts deleted file mode 100644 index d35fb8eaa0ff..000000000000 --- a/sdk/redis/arm-rediscache/src/operationsInterfaces/redis.ts +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - UpgradeNotification, - RedisListUpgradeNotificationsOptionalParams, - RedisResource, - RedisListByResourceGroupOptionalParams, - RedisListBySubscriptionOptionalParams, - CheckNameAvailabilityParameters, - RedisCheckNameAvailabilityOptionalParams, - RedisCreateParameters, - RedisCreateOptionalParams, - RedisCreateResponse, - RedisUpdateParameters, - RedisUpdateOptionalParams, - RedisUpdateResponse, - RedisDeleteOptionalParams, - RedisGetOptionalParams, - RedisGetResponse, - RedisListKeysOptionalParams, - RedisListKeysResponse, - RedisRegenerateKeyParameters, - RedisRegenerateKeyOptionalParams, - RedisRegenerateKeyResponse, - RedisRebootParameters, - RedisForceRebootOptionalParams, - RedisForceRebootOperationResponse, - ImportRDBParameters, - RedisImportDataOptionalParams, - ExportRDBParameters, - RedisExportDataOptionalParams, - RedisFlushCacheOptionalParams, - RedisFlushCacheResponse, -} from "../models/index.js"; - -/// -/** Interface representing a Redis. */ -export interface Redis { - /** - * Gets any upgrade notifications for a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param history how many minutes in past to look for upgrade notifications - * @param options The options parameters. - */ - listUpgradeNotifications( - resourceGroupName: string, - name: string, - history: number, - options?: RedisListUpgradeNotificationsOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Lists all Redis caches in a resource group. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param options The options parameters. - */ - listByResourceGroup( - resourceGroupName: string, - options?: RedisListByResourceGroupOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets all Redis caches in the specified subscription. - * @param options The options parameters. - */ - listBySubscription( - options?: RedisListBySubscriptionOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Checks that the redis cache name is valid and is not already in use. - * @param parameters Parameters supplied to the CheckNameAvailability Redis operation. The only - * supported resource type is 'Microsoft.Cache/redis' - * @param options The options parameters. - */ - checkNameAvailability( - parameters: CheckNameAvailabilityParameters, - options?: RedisCheckNameAvailabilityOptionalParams, - ): Promise; - /** - * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Create Redis operation. - * @param options The options parameters. - */ - beginCreate( - resourceGroupName: string, - name: string, - parameters: RedisCreateParameters, - options?: RedisCreateOptionalParams, - ): Promise< - SimplePollerLike, RedisCreateResponse> - >; - /** - * Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Create Redis operation. - * @param options The options parameters. - */ - beginCreateAndWait( - resourceGroupName: string, - name: string, - parameters: RedisCreateParameters, - options?: RedisCreateOptionalParams, - ): Promise; - /** - * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Update Redis operation. - * @param options The options parameters. - */ - beginUpdate( - resourceGroupName: string, - name: string, - parameters: RedisUpdateParameters, - options?: RedisUpdateOptionalParams, - ): Promise< - SimplePollerLike, RedisUpdateResponse> - >; - /** - * Update an existing Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters supplied to the Update Redis operation. - * @param options The options parameters. - */ - beginUpdateAndWait( - resourceGroupName: string, - name: string, - parameters: RedisUpdateParameters, - options?: RedisUpdateOptionalParams, - ): Promise; - /** - * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - beginDelete( - resourceGroupName: string, - name: string, - options?: RedisDeleteOptionalParams, - ): Promise, void>>; - /** - * Deletes a Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - beginDeleteAndWait( - resourceGroupName: string, - name: string, - options?: RedisDeleteOptionalParams, - ): Promise; - /** - * Gets a Redis cache (resource description). - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - get( - resourceGroupName: string, - name: string, - options?: RedisGetOptionalParams, - ): Promise; - /** - * Retrieve a Redis cache's access keys. This operation requires write permission to the cache - * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param options The options parameters. - */ - listKeys( - resourceGroupName: string, - name: string, - options?: RedisListKeysOptionalParams, - ): Promise; - /** - * Regenerate Redis cache's access keys. This operation requires write permission to the cache - * resource. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Specifies which key to regenerate. - * @param options The options parameters. - */ - regenerateKey( - resourceGroupName: string, - name: string, - parameters: RedisRegenerateKeyParameters, - options?: RedisRegenerateKeyOptionalParams, - ): Promise; - /** - * Reboot specified Redis node(s). This operation requires write permission to the cache resource. - * There can be potential data loss. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Specifies which Redis node(s) to reboot. - * @param options The options parameters. - */ - forceReboot( - resourceGroupName: string, - name: string, - parameters: RedisRebootParameters, - options?: RedisForceRebootOptionalParams, - ): Promise; - /** - * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis import operation. - * @param options The options parameters. - */ - beginImportData( - resourceGroupName: string, - name: string, - parameters: ImportRDBParameters, - options?: RedisImportDataOptionalParams, - ): Promise, void>>; - /** - * Import data into Redis cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis import operation. - * @param options The options parameters. - */ - beginImportDataAndWait( - resourceGroupName: string, - name: string, - parameters: ImportRDBParameters, - options?: RedisImportDataOptionalParams, - ): Promise; - /** - * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis export operation. - * @param options The options parameters. - */ - beginExportData( - resourceGroupName: string, - name: string, - parameters: ExportRDBParameters, - options?: RedisExportDataOptionalParams, - ): Promise, void>>; - /** - * Export data from the redis cache to blobs in a container. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param name The name of the Redis cache. - * @param parameters Parameters for Redis export operation. - * @param options The options parameters. - */ - beginExportDataAndWait( - resourceGroupName: string, - name: string, - parameters: ExportRDBParameters, - options?: RedisExportDataOptionalParams, - ): Promise; - /** - * Deletes all of the keys in a cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - beginFlushCache( - resourceGroupName: string, - cacheName: string, - options?: RedisFlushCacheOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - RedisFlushCacheResponse - > - >; - /** - * Deletes all of the keys in a cache. - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param cacheName The name of the Redis cache. - * @param options The options parameters. - */ - beginFlushCacheAndWait( - resourceGroupName: string, - cacheName: string, - options?: RedisFlushCacheOptionalParams, - ): Promise; -} diff --git a/sdk/redis/arm-rediscache/src/pagingHelper.ts b/sdk/redis/arm-rediscache/src/pagingHelper.ts deleted file mode 100644 index 205cccc26592..000000000000 --- a/sdk/redis/arm-rediscache/src/pagingHelper.ts +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -export interface PageInfo { - continuationToken?: string; -} - -const pageMap = new WeakMap(); - -/** - * Given the last `.value` produced by the `byPage` iterator, - * returns a continuation token that can be used to begin paging from - * that point later. - * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. - * @returns The continuation token that can be passed into byPage() during future calls. - */ -export function getContinuationToken(page: unknown): string | undefined { - if (typeof page !== "object" || page === null) { - return undefined; - } - return pageMap.get(page)?.continuationToken; -} - -export function setContinuationToken( - page: unknown, - continuationToken: string | undefined, -): void { - if (typeof page !== "object" || page === null || !continuationToken) { - return; - } - const pageInfo = pageMap.get(page) ?? {}; - pageInfo.continuationToken = continuationToken; - pageMap.set(page, pageInfo); -} diff --git a/sdk/redis/arm-rediscache/src/redisManagementClient.ts b/sdk/redis/arm-rediscache/src/redisManagementClient.ts index c35eea619956..c673a79cb703 100644 --- a/sdk/redis/arm-rediscache/src/redisManagementClient.ts +++ b/sdk/redis/arm-rediscache/src/redisManagementClient.ts @@ -1,181 +1,83 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. -import * as coreClient from "@azure/core-client"; -import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { - PipelineRequest, - PipelineResponse, - SendRequest, -} from "@azure/core-rest-pipeline"; -import * as coreAuth from "@azure/core-auth"; -import { - OperationsImpl, - RedisImpl, - FirewallRulesImpl, - PatchSchedulesImpl, - LinkedServerImpl, - PrivateEndpointConnectionsImpl, - PrivateLinkResourcesImpl, - AsyncOperationStatusImpl, - AccessPolicyImpl, - AccessPolicyAssignmentImpl, -} from "./operations/index.js"; -import { - Operations, - Redis, - FirewallRules, - PatchSchedules, - LinkedServer, - PrivateEndpointConnections, - PrivateLinkResources, - AsyncOperationStatus, - AccessPolicy, - AccessPolicyAssignment, -} from "./operationsInterfaces/index.js"; -import { RedisManagementClientOptionalParams } from "./models/index.js"; +import type { RedisManagementContext, RedisManagementClientOptionalParams } from "./api/index.js"; +import { createRedisManagement } from "./api/index.js"; +import type { AccessPolicyOperations } from "./classic/accessPolicy/index.js"; +import { _getAccessPolicyOperations } from "./classic/accessPolicy/index.js"; +import type { AccessPolicyAssignmentOperations } from "./classic/accessPolicyAssignment/index.js"; +import { _getAccessPolicyAssignmentOperations } from "./classic/accessPolicyAssignment/index.js"; +import type { AsyncOperationStatusOperations } from "./classic/asyncOperationStatus/index.js"; +import { _getAsyncOperationStatusOperations } from "./classic/asyncOperationStatus/index.js"; +import type { FirewallRulesOperations } from "./classic/firewallRules/index.js"; +import { _getFirewallRulesOperations } from "./classic/firewallRules/index.js"; +import type { LinkedServerOperations } from "./classic/linkedServer/index.js"; +import { _getLinkedServerOperations } from "./classic/linkedServer/index.js"; +import type { OperationsOperations } from "./classic/operations/index.js"; +import { _getOperationsOperations } from "./classic/operations/index.js"; +import type { PatchSchedulesOperations } from "./classic/patchSchedules/index.js"; +import { _getPatchSchedulesOperations } from "./classic/patchSchedules/index.js"; +import type { PrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import { _getPrivateEndpointConnectionsOperations } from "./classic/privateEndpointConnections/index.js"; +import type { PrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import { _getPrivateLinkResourcesOperations } from "./classic/privateLinkResources/index.js"; +import type { RedisOperations } from "./classic/redis/index.js"; +import { _getRedisOperations } from "./classic/redis/index.js"; +import type { TokenCredential } from "@azure/core-auth"; +import type { Pipeline } from "@azure/core-rest-pipeline"; -export class RedisManagementClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; +export { RedisManagementClientOptionalParams } from "./api/redisManagementContext.js"; - /** - * Initializes a new instance of the RedisManagementClient class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ +export class RedisManagementClient { + private _client: RedisManagementContext; + /** The pipeline used by this client to make requests */ + public readonly pipeline: Pipeline; + + /** REST API for Azure Redis Cache Service. */ constructor( - credentials: coreAuth.TokenCredential, + credential: TokenCredential, subscriptionId: string, - options?: RedisManagementClientOptionalParams, + options: RedisManagementClientOptionalParams = {}, ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: RedisManagementClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials, - }; - - const packageDetails = `azsdk-js-arm-rediscache/8.2.2`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, + const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; + const userAgentPrefix = prefixFromOptions + ? `${prefixFromOptions} azsdk-js-client` + : `azsdk-js-client`; + this._client = createRedisManagement(credential, subscriptionId, { ...options, - userAgentOptions: { - userAgentPrefix, - }, - endpoint: - options.endpoint ?? options.baseUri ?? "https://management.azure.com", - }; - super(optionsWithDefaults); - - let bearerTokenAuthenticationPolicyFound: boolean = false; - if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) { - const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = - options.pipeline.getOrderedPolicies(); - bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( - (pipelinePolicy) => - pipelinePolicy.name === - coreRestPipeline.bearerTokenAuthenticationPolicyName, - ); - } - if ( - !options || - !options.pipeline || - options.pipeline.getOrderedPolicies().length == 0 || - !bearerTokenAuthenticationPolicyFound - ) { - this.pipeline.removePolicy({ - name: coreRestPipeline.bearerTokenAuthenticationPolicyName, - }); - this.pipeline.addPolicy( - coreRestPipeline.bearerTokenAuthenticationPolicy({ - credential: credentials, - scopes: - optionsWithDefaults.credentialScopes ?? - `${optionsWithDefaults.endpoint}/.default`, - challengeCallbacks: { - authorizeRequestOnChallenge: - coreClient.authorizeRequestOnClaimChallenge, - }, - }), - ); - } - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2024-11-01"; - this.operations = new OperationsImpl(this); - this.redis = new RedisImpl(this); - this.firewallRules = new FirewallRulesImpl(this); - this.patchSchedules = new PatchSchedulesImpl(this); - this.linkedServer = new LinkedServerImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); - this.privateLinkResources = new PrivateLinkResourcesImpl(this); - this.asyncOperationStatus = new AsyncOperationStatusImpl(this); - this.accessPolicy = new AccessPolicyImpl(this); - this.accessPolicyAssignment = new AccessPolicyAssignmentImpl(this); - this.addCustomApiVersionPolicy(options.apiVersion); - } - - /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ - private addCustomApiVersionPolicy(apiVersion?: string) { - if (!apiVersion) { - return; - } - const apiVersionPolicy = { - name: "CustomApiVersionPolicy", - async sendRequest( - request: PipelineRequest, - next: SendRequest, - ): Promise { - const param = request.url.split("?"); - if (param.length > 1) { - const newParams = param[1].split("&").map((item) => { - if (item.indexOf("api-version") > -1) { - return "api-version=" + apiVersion; - } else { - return item; - } - }); - request.url = param[0] + "?" + newParams.join("&"); - } - return next(request); - }, - }; - this.pipeline.addPolicy(apiVersionPolicy); + userAgentOptions: { userAgentPrefix }, + }); + this.pipeline = this._client.pipeline; + this.asyncOperationStatus = _getAsyncOperationStatusOperations(this._client); + this.accessPolicyAssignment = _getAccessPolicyAssignmentOperations(this._client); + this.accessPolicy = _getAccessPolicyOperations(this._client); + this.patchSchedules = _getPatchSchedulesOperations(this._client); + this.firewallRules = _getFirewallRulesOperations(this._client); + this.privateLinkResources = _getPrivateLinkResourcesOperations(this._client); + this.redis = _getRedisOperations(this._client); + this.privateEndpointConnections = _getPrivateEndpointConnectionsOperations(this._client); + this.linkedServer = _getLinkedServerOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - operations: Operations; - redis: Redis; - firewallRules: FirewallRules; - patchSchedules: PatchSchedules; - linkedServer: LinkedServer; - privateEndpointConnections: PrivateEndpointConnections; - privateLinkResources: PrivateLinkResources; - asyncOperationStatus: AsyncOperationStatus; - accessPolicy: AccessPolicy; - accessPolicyAssignment: AccessPolicyAssignment; + /** The operation groups for asyncOperationStatus */ + public readonly asyncOperationStatus: AsyncOperationStatusOperations; + /** The operation groups for accessPolicyAssignment */ + public readonly accessPolicyAssignment: AccessPolicyAssignmentOperations; + /** The operation groups for accessPolicy */ + public readonly accessPolicy: AccessPolicyOperations; + /** The operation groups for patchSchedules */ + public readonly patchSchedules: PatchSchedulesOperations; + /** The operation groups for firewallRules */ + public readonly firewallRules: FirewallRulesOperations; + /** The operation groups for privateLinkResources */ + public readonly privateLinkResources: PrivateLinkResourcesOperations; + /** The operation groups for redis */ + public readonly redis: RedisOperations; + /** The operation groups for privateEndpointConnections */ + public readonly privateEndpointConnections: PrivateEndpointConnectionsOperations; + /** The operation groups for linkedServer */ + public readonly linkedServer: LinkedServerOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } diff --git a/sdk/redis/arm-rediscache/src/restorePollerHelpers.ts b/sdk/redis/arm-rediscache/src/restorePollerHelpers.ts new file mode 100644 index 000000000000..71db84261496 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/restorePollerHelpers.ts @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { RedisManagementClient } from "./redisManagementClient.js"; +import { + _$deleteDeserialize, + _createUpdateDeserialize, +} from "./api/accessPolicyAssignment/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeAccessPolicy, + _createUpdateDeserialize as _createUpdateDeserializeAccessPolicy, +} from "./api/accessPolicy/operations.js"; +import { + _flushCacheDeserialize, + _exportDataDeserialize, + _importDataDeserialize, + _$deleteDeserialize as _$deleteDeserializeRedis, + _updateDeserialize, + _createDeserialize, +} from "./api/redis/operations.js"; +import { _putDeserialize } from "./api/privateEndpointConnections/operations.js"; +import { + _$deleteDeserialize as _$deleteDeserializeLinkedServer, + _createDeserialize as _createDeserializeLinkedServer, +} from "./api/linkedServer/operations.js"; +import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; +import type { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; +import type { PollerLike, OperationState, ResourceLocationConfig } from "@azure/core-lro"; +import { deserializeState } from "@azure/core-lro"; + +export interface RestorePollerOptions< + TResult, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +> extends OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** Deserialization function for raw response body */ + processResponseBody?: (result: TResponse) => Promise; +} + +/** + * Creates a poller from the serialized state of another poller. This can be + * useful when you want to create pollers on a different host or a poller + * needs to be constructed after the original one is not in scope. + */ +export function restorePoller( + client: RedisManagementClient, + serializedState: string, + sourceOperation: (...args: any[]) => PollerLike, TResult>, + options?: RestorePollerOptions, +): PollerLike, TResult> { + const pollerConfig = deserializeState(serializedState).config; + const { initialRequestUrl, requestMethod, metadata } = pollerConfig; + if (!initialRequestUrl || !requestMethod) { + throw new Error( + `Invalid serialized state: ${serializedState} for sourceOperation ${sourceOperation?.name}`, + ); + } + const resourceLocationConfig = metadata?.["resourceLocationConfig"] as + | ResourceLocationConfig + | undefined; + const { deserializer, expectedStatuses = [] } = + getDeserializationHelper(initialRequestUrl, requestMethod) ?? {}; + const deserializeHelper = options?.processResponseBody ?? deserializer; + if (!deserializeHelper) { + throw new Error( + `Please ensure the operation is in this client! We can't find its deserializeHelper for ${sourceOperation?.name}.`, + ); + } + return getLongRunningPoller( + (client as any)["_client"] ?? client, + deserializeHelper as (result: TResponse) => Promise, + expectedStatuses, + { + updateIntervalInMs: options?.updateIntervalInMs, + abortSignal: options?.abortSignal, + resourceLocationConfig, + restoreFrom: serializedState, + initialRequestUrl, + }, + ); +} + +interface DeserializationHelper { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type + deserializer: Function; + expectedStatuses: string[]; +} + +const deserializeMap: Record = { + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}": + { + deserializer: _$deleteDeserialize, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicyAssignments/{accessPolicyAssignmentName}": + { + deserializer: _createUpdateDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}": + { + deserializer: _$deleteDeserializeAccessPolicy, + expectedStatuses: ["200", "202", "204"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/accessPolicies/{accessPolicyName}": + { + deserializer: _createUpdateDeserializeAccessPolicy, + expectedStatuses: ["200", "201", "202"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/flush": + { deserializer: _flushCacheDeserialize, expectedStatuses: ["200", "202"] }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/export": + { + deserializer: _exportDataDeserialize, + expectedStatuses: ["200", "202", "204"], + }, + "POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/import": + { + deserializer: _importDataDeserialize, + expectedStatuses: ["200", "202", "204"], + }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}": + { + deserializer: _$deleteDeserializeRedis, + expectedStatuses: ["200", "202", "204"], + }, + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}": + { deserializer: _updateDeserialize, expectedStatuses: ["200", "202"] }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}": + { + deserializer: _createDeserialize, + expectedStatuses: ["200", "201", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{cacheName}/privateEndpointConnections/{privateEndpointConnectionName}": + { deserializer: _putDeserialize, expectedStatuses: ["200", "201", "202"] }, + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}": + { + deserializer: _$deleteDeserializeLinkedServer, + expectedStatuses: ["200", "202"], + }, + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redis/{name}/linkedServers/{linkedServerName}": + { + deserializer: _createDeserializeLinkedServer, + expectedStatuses: ["200", "201", "202"], + }, +}; + +function getDeserializationHelper( + urlStr: string, + method: string, +): DeserializationHelper | undefined { + const path = new URL(urlStr).pathname; + const pathParts = path.split("/"); + + // Traverse list to match the longest candidate + // matchedLen: the length of candidate path + // matchedValue: the matched status code array + let matchedLen = -1, + matchedValue: DeserializationHelper | undefined; + + // Iterate the responseMap to find a match + for (const [key, value] of Object.entries(deserializeMap)) { + // Extracting the path from the map key which is in format + // GET /path/foo + if (!key.startsWith(method)) { + continue; + } + const candidatePath = getPathFromMapKey(key); + // Get each part of the url path + const candidateParts = candidatePath.split("/"); + + // track if we have found a match to return the values found. + let found = true; + for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { + if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + const start = candidateParts[i]!.indexOf("}") + 1, + end = candidateParts[i]?.length; + // If the current part of the candidate is a "template" part + // Try to use the suffix of pattern to match the path + // {guid} ==> $ + // {guid}:export ==> :export$ + const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( + pathParts[j] || "", + ); + + if (!isMatched) { + found = false; + break; + } + continue; + } + + // If the candidate part is not a template and + // the parts don't match mark the candidate as not found + // to move on with the next candidate path. + if (candidateParts[i] !== pathParts[j]) { + found = false; + break; + } + } + + // We finished evaluating the current candidate parts + // Update the matched value if and only if we found the longer pattern + if (found && candidatePath.length > matchedLen) { + matchedLen = candidatePath.length; + matchedValue = value; + } + } + + return matchedValue; +} + +function getPathFromMapKey(mapKey: string): string { + const pathStart = mapKey.indexOf("/"); + return mapKey.slice(pathStart); +} diff --git a/sdk/redis/arm-rediscache/src/static-helpers/cloudSettingHelpers.ts b/sdk/redis/arm-rediscache/src/static-helpers/cloudSettingHelpers.ts new file mode 100644 index 000000000000..613112c6e397 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/static-helpers/cloudSettingHelpers.ts @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * An enum to describe Azure Cloud environments. + * @enum {string} + */ +export enum AzureClouds { + /** Azure public cloud, which is the default cloud for Azure SDKs. */ + AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD", + /** Azure China cloud */ + AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD", + /** Azure US government cloud */ + AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT", +} + +/** The supported values for cloud setting as a string literal type */ +export type AzureSupportedClouds = `${AzureClouds}`; + +/** + * Gets the Azure Resource Manager endpoint URL for the specified cloud setting. + * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values. + * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined. + * @throws {Error} Throws an error if an unknown cloud setting is provided. + */ +export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined { + if (cloudSetting === undefined) { + return undefined; + } + const cloudEndpoints: Record = { + AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/", + AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/", + AZURE_PUBLIC_CLOUD: "https://management.azure.com/", + }; + if (cloudSetting in cloudEndpoints) { + return cloudEndpoints[cloudSetting]; + } else { + throw new Error( + `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`, + ); + } +} diff --git a/sdk/redis/arm-rediscache/src/static-helpers/pagingHelpers.ts b/sdk/redis/arm-rediscache/src/static-helpers/pagingHelpers.ts new file mode 100644 index 000000000000..11248b3804e4 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/static-helpers/pagingHelpers.ts @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import { RestError } from "@azure/core-rest-pipeline"; + +/** + * Options for the byPage method + */ +export interface PageSettings { + /** + * A reference to a specific page to start iterating from. + */ + continuationToken?: string; +} + +/** + * An interface that describes a page of results. + */ +export type ContinuablePage = TPage & { + /** + * The token that keeps track of where to continue the iterator + */ + continuationToken?: string; +}; + +/** + * An interface that allows async iterable iteration both to completion and by page. + */ +export interface PagedAsyncIterableIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * The next method, part of the iteration protocol + */ + next(): Promise>; + /** + * The connection to the async iterator, part of the iteration protocol + */ + [Symbol.asyncIterator](): PagedAsyncIterableIterator; + /** + * Return an AsyncIterableIterator that works a page at a time + */ + byPage: (settings?: TPageSettings) => AsyncIterableIterator>; +} + +/** + * An interface that describes how to communicate with the service. + */ +export interface PagedResult< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +> { + /** + * Link to the first page of results. + */ + firstPageLink?: string; + /** + * A method that returns a page of results. + */ + getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>; + /** + * a function to implement the `byPage` method on the paged async iterator. + */ + byPage?: (settings?: TPageSettings) => AsyncIterableIterator>; + + /** + * A function to extract elements from a page. + */ + toElements?: (page: TPage) => TElement[]; +} + +/** + * Options for the paging helper + */ +export interface BuildPagedAsyncIteratorOptions { + itemName?: string; + nextLinkName?: string; +} + +/** + * Helper to paginate results in a generic way and return a PagedAsyncIterableIterator + */ +export function buildPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, + TResponse extends PathUncheckedResponse = PathUncheckedResponse, +>( + client: Client, + getInitialResponse: () => PromiseLike, + processResponseBody: (result: TResponse) => PromiseLike, + expectedStatuses: string[], + options: BuildPagedAsyncIteratorOptions = {}, +): PagedAsyncIterableIterator { + const itemName = options.itemName ?? "value"; + const nextLinkName = options.nextLinkName ?? "nextLink"; + const pagedResult: PagedResult = { + getPage: async (pageLink?: string) => { + const result = + pageLink === undefined + ? await getInitialResponse() + : await client.pathUnchecked(pageLink).get(); + checkPagingRequest(result, expectedStatuses); + const results = await processResponseBody(result as TResponse); + const nextLink = getNextLink(results, nextLinkName); + const values = getElements(results, itemName) as TPage; + return { + page: values, + nextPageLink: nextLink, + }; + }, + byPage: (settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }, + }; + return getPagedAsyncIterator(pagedResult); +} + +/** + * returns an async iterator that iterates over results. It also has a `byPage` + * method that returns pages of items at once. + * + * @param pagedResult - an object that specifies how to get pages. + * @returns a paged async iterator that iterates over results. + */ + +function getPagedAsyncIterator< + TElement, + TPage = TElement[], + TPageSettings extends PageSettings = PageSettings, +>( + pagedResult: PagedResult, +): PagedAsyncIterableIterator { + const iter = getItemAsyncIterator(pagedResult); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: + pagedResult?.byPage ?? + ((settings?: TPageSettings) => { + const { continuationToken } = settings ?? {}; + return getPageAsyncIterator(pagedResult, { + pageLink: continuationToken, + }); + }), + }; +} + +async function* getItemAsyncIterator( + pagedResult: PagedResult, +): AsyncIterableIterator { + const pages = getPageAsyncIterator(pagedResult); + for await (const page of pages) { + yield* page as unknown as TElement[]; + } +} + +async function* getPageAsyncIterator( + pagedResult: PagedResult, + options: { + pageLink?: string; + } = {}, +): AsyncIterableIterator> { + const { pageLink } = options; + let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink); + if (!response) { + return; + } + let result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + while (response.nextPageLink) { + response = await pagedResult.getPage(response.nextPageLink); + if (!response) { + return; + } + result = response.page as ContinuablePage; + result.continuationToken = response.nextPageLink; + yield result; + } +} + +/** + * Gets for the value of nextLink in the body + */ +function getNextLink(body: unknown, nextLinkName?: string): string | undefined { + if (!nextLinkName) { + return undefined; + } + + const nextLink = (body as Record)[nextLinkName]; + + if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) { + throw new RestError( + `Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`, + ); + } + + if (nextLink === null) { + return undefined; + } + + return nextLink; +} + +/** + * Gets the elements of the current request in the body. + */ +function getElements(body: unknown, itemName: string): T[] { + const value = (body as Record)[itemName] as T[]; + if (!Array.isArray(value)) { + throw new RestError( + `Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`, + ); + } + + return value ?? []; +} + +/** + * Checks if a request failed + */ +function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void { + if (!expectedStatuses.includes(response.status)) { + throw createRestError( + `Pagination failed with unexpected statusCode ${response.status}`, + response, + ); + } +} diff --git a/sdk/redis/arm-rediscache/src/static-helpers/pollingHelpers.ts b/sdk/redis/arm-rediscache/src/static-helpers/pollingHelpers.ts new file mode 100644 index 000000000000..63b3c201e5a8 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/static-helpers/pollingHelpers.ts @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import type { + PollerLike, + OperationState, + ResourceLocationConfig, + RunningOperation, + OperationResponse, +} from "@azure/core-lro"; +import { createHttpPoller } from "@azure/core-lro"; + +import type { Client, PathUncheckedResponse } from "@azure-rest/core-client"; +import { createRestError } from "@azure-rest/core-client"; +import type { AbortSignalLike } from "@azure/abort-controller"; + +export interface GetLongRunningPollerOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** + * The signal which can be used to abort requests. + */ + abortSignal?: AbortSignalLike; + /** + * The potential location of the result of the LRO if specified by the LRO extension in the swagger. + */ + resourceLocationConfig?: ResourceLocationConfig; + /** + * The original url of the LRO + * Should not be null when restoreFrom is set + */ + initialRequestUrl?: string; + /** + * A serialized poller which can be used to resume an existing paused Long-Running-Operation. + */ + restoreFrom?: string; + /** + * The function to get the initial response + */ + getInitialResponse?: () => PromiseLike; +} +export function getLongRunningPoller( + client: Client, + processResponseBody: (result: TResponse) => Promise, + expectedStatuses: string[], + options: GetLongRunningPollerOptions, +): PollerLike, TResult> { + const { restoreFrom, getInitialResponse } = options; + if (!restoreFrom && !getInitialResponse) { + throw new Error("Either restoreFrom or getInitialResponse must be specified"); + } + let initialResponse: TResponse | undefined = undefined; + const pollAbortController = new AbortController(); + const poller: RunningOperation = { + sendInitialRequest: async () => { + if (!getInitialResponse) { + throw new Error("getInitialResponse is required when initializing a new poller"); + } + initialResponse = await getInitialResponse(); + return getLroResponse(initialResponse, expectedStatuses); + }, + sendPollRequest: async ( + path: string, + pollOptions?: { + abortSignal?: AbortSignalLike; + }, + ) => { + // The poll request would both listen to the user provided abort signal and the poller's own abort signal + function abortListener(): void { + pollAbortController.abort(); + } + const abortSignal = pollAbortController.signal; + if (options.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (pollOptions?.abortSignal?.aborted) { + pollAbortController.abort(); + } else if (!abortSignal.aborted) { + options.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + pollOptions?.abortSignal?.addEventListener("abort", abortListener, { + once: true, + }); + } + let response; + try { + response = await client.pathUnchecked(path).get({ abortSignal }); + } finally { + options.abortSignal?.removeEventListener("abort", abortListener); + pollOptions?.abortSignal?.removeEventListener("abort", abortListener); + } + + return getLroResponse(response as TResponse, expectedStatuses); + }, + }; + return createHttpPoller(poller, { + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: options?.resourceLocationConfig, + restoreFrom: options?.restoreFrom, + processResult: (result: unknown) => { + return processResponseBody(result as TResponse); + }, + }); +} +/** + * Converts a Rest Client response to a response that the LRO implementation understands + * @param response - a rest client http response + * @param deserializeFn - deserialize function to convert Rest response to modular output + * @returns - An LRO response that the LRO implementation understands + */ +function getLroResponse( + response: TResponse, + expectedStatuses: string[], +): OperationResponse { + if (!expectedStatuses.includes(response.status)) { + throw createRestError(response); + } + + return { + flatResponse: response, + rawResponse: { + ...response, + statusCode: Number.parseInt(response.status), + body: response.body, + }, + }; +} diff --git a/sdk/redis/arm-rediscache/src/static-helpers/serialization/serialize-record.ts b/sdk/redis/arm-rediscache/src/static-helpers/serialization/serialize-record.ts new file mode 100644 index 000000000000..f2d3a221fef7 --- /dev/null +++ b/sdk/redis/arm-rediscache/src/static-helpers/serialization/serialize-record.ts @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +export function serializeRecord(item: any, excludes?: string[], serializer?: (item: any) => any) { + excludes = excludes ?? []; + const res: any = {}; + for (const key of Object.keys(item)) { + if (excludes.includes(key) || item[key] === undefined) { + continue; + } + if (serializer) { + res[key] = serializer(item[key]); + } else { + res[key] = item[key] as any; + } + } + return res; +} diff --git a/sdk/redis/arm-rediscache/src/static-helpers/urlTemplate.ts b/sdk/redis/arm-rediscache/src/static-helpers/urlTemplate.ts new file mode 100644 index 000000000000..657898dd38ff --- /dev/null +++ b/sdk/redis/arm-rediscache/src/static-helpers/urlTemplate.ts @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +// --------------------- +// interfaces +// --------------------- +interface ValueOptions { + isFirst: boolean; // is first value in the expression + op?: string; // operator + varValue?: any; // variable value + varName?: string; // variable name + modifier?: string; // modifier e.g * + reserved?: boolean; // if true we'll keep reserved words with not encoding +} + +export interface UrlTemplateOptions { + // if set to true, reserved characters will not be encoded + allowReserved?: boolean; +} + +// --------------------- +// helpers +// --------------------- +function encodeComponent(val: string, reserved?: boolean, op?: string): string { + return (reserved ?? op === "+") || op === "#" + ? encodeReservedComponent(val) + : encodeRFC3986URIComponent(val); +} + +function encodeReservedComponent(str: string): string { + return str + .split(/(%[0-9A-Fa-f]{2})/g) + .map((part) => (!/%[0-9A-Fa-f]/.test(part) ? encodeURI(part) : part)) + .join(""); +} + +function encodeRFC3986URIComponent(str: string): string { + return encodeURIComponent(str).replace( + /[!'()*]/g, + (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`, + ); +} + +function isDefined(val: any): boolean { + return val !== undefined && val !== null; +} + +function getNamedAndIfEmpty(op?: string): [boolean, string] { + return [!!op && [";", "?", "&"].includes(op), !!op && ["?", "&"].includes(op) ? "=" : ""]; +} + +function getFirstOrSep(op?: string, isFirst = false): string { + if (isFirst) { + return !op || op === "+" ? "" : op; + } else if (!op || op === "+" || op === "#") { + return ","; + } else if (op === "?") { + return "&"; + } else { + return op; + } +} + +function getExpandedValue(option: ValueOptions): string { + let isFirst = option.isFirst; + const { op, varName, varValue: value, reserved } = option; + const vals: string[] = []; + const [named, ifEmpty] = getNamedAndIfEmpty(op); + + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + // prepare the following parts: separator, varName, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (named && varName) { + vals.push(`${encodeURIComponent(varName)}`); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + const val = value[key]; + if (!isDefined(val)) { + continue; + } + // prepare the following parts: separator, key, value + vals.push(`${getFirstOrSep(op, isFirst)}`); + if (key) { + vals.push(`${encodeURIComponent(key)}`); + if (named && val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + vals.push(encodeComponent(val, reserved, op)); + isFirst = false; + } + } + return vals.join(""); +} + +function getNonExpandedValue(option: ValueOptions): string | undefined { + const { op, varName, varValue: value, isFirst, reserved } = option; + const vals: string[] = []; + const first = getFirstOrSep(op, isFirst); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + if (named && varName) { + vals.push(encodeComponent(varName, reserved, op)); + if (value === "") { + if (!ifEmpty) { + vals.push(ifEmpty); + } + return !vals.join("") ? undefined : `${first}${vals.join("")}`; + } + vals.push("="); + } + + const items = []; + if (Array.isArray(value)) { + for (const val of value.filter(isDefined)) { + items.push(encodeComponent(val, reserved, op)); + } + } else if (typeof value === "object") { + for (const key of Object.keys(value)) { + if (!isDefined(value[key])) { + continue; + } + items.push(encodeRFC3986URIComponent(key)); + items.push(encodeComponent(value[key], reserved, op)); + } + } + vals.push(items.join(",")); + return !vals.join(",") ? undefined : `${first}${vals.join("")}`; +} + +function getVarValue(option: ValueOptions): string | undefined { + const { op, varName, modifier, isFirst, reserved, varValue: value } = option; + + if (!isDefined(value)) { + return undefined; + } else if (["string", "number", "boolean"].includes(typeof value)) { + let val = value.toString(); + const [named, ifEmpty] = getNamedAndIfEmpty(op); + const vals: string[] = [getFirstOrSep(op, isFirst)]; + if (named && varName) { + // No need to encode varName considering it is already encoded + vals.push(varName); + if (val === "") { + vals.push(ifEmpty); + } else { + vals.push("="); + } + } + if (modifier && modifier !== "*") { + val = val.substring(0, parseInt(modifier, 10)); + } + vals.push(encodeComponent(val, reserved, op)); + return vals.join(""); + } else if (modifier === "*") { + return getExpandedValue(option); + } else { + return getNonExpandedValue(option); + } +} + +// --------------------------------------------------------------------------------------------------- +// This is an implementation of RFC 6570 URI Template: https://datatracker.ietf.org/doc/html/rfc6570. +// --------------------------------------------------------------------------------------------------- +export function expandUrlTemplate( + template: string, + context: Record, + option?: UrlTemplateOptions, +): string { + return template.replace(/\{([^{}]+)\}|([^{}]+)/g, (_, expr, text) => { + if (!expr) { + return encodeReservedComponent(text); + } + let op; + if (["+", "#", ".", "/", ";", "?", "&"].includes(expr[0])) { + op = expr[0]; + expr = expr.slice(1); + } + const varList = expr.split(/,/g); + const result = []; + for (const varSpec of varList) { + const varMatch = /([^:*]*)(?::(\d+)|(\*))?/.exec(varSpec); + if (!varMatch || !varMatch[1]) { + continue; + } + const varValue = getVarValue({ + isFirst: result.length === 0, + op, + varValue: context[varMatch[1]], + varName: varMatch[1], + modifier: varMatch[2] || varMatch[3], + reserved: option?.allowReserved, + }); + if (varValue) { + result.push(varValue); + } + } + return result.join(""); + }); +} diff --git a/sdk/redis/arm-rediscache/test/redis_examples.spec.ts b/sdk/redis/arm-rediscache/test/redis_examples.spec.ts index 3eb354704706..9d91e5160451 100644 --- a/sdk/redis/arm-rediscache/test/redis_examples.spec.ts +++ b/sdk/redis/arm-rediscache/test/redis_examples.spec.ts @@ -108,36 +108,39 @@ describe("Redis test", () => { it("Redis create test", async () => { // create network resource await createVirtualNetwork(resourceGroupName, location, networkName, subnetName); - const res = await client.redis.beginCreateAndWait( + const poller = client.redis.create( resourceGroupName, name, { location: location, zones: ["1"], - sku: { - name: "Premium", - family: "P", - capacity: 1, + properties: { + sku: { + name: "Premium", + family: "P", + capacity: 1, + }, + enableNonSslPort: true, + shardCount: 2, + redisConfiguration: { + maxmemoryPolicy: "allkeys-lru", + }, + subnetId: + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Network/virtualNetworks/" + + networkName + + "/subnets/" + + subnetName, + staticIP: "10.0.0.5", + minimumTlsVersion: "1.2", }, - enableNonSslPort: true, - shardCount: 2, - redisConfiguration: { - maxmemoryPolicy: "allkeys-lru", - }, - subnetId: - "/subscriptions/" + - subscriptionId + - "/resourceGroups/" + - resourceGroupName + - "/providers/Microsoft.Network/virtualNetworks/" + - networkName + - "/subnets/" + - subnetName, - staticIP: "10.0.0.5", - minimumTlsVersion: "1.2", }, testPollingOptions, ); + const res = await poller.pollUntilDone(); assert.equal(res.name, name); }); @@ -148,17 +151,19 @@ describe("Redis test", () => { it("patchSchedules create for redis test", async () => { const res = await client.patchSchedules.createOrUpdate(resourceGroupName, name, "default", { - scheduleEntries: [ - { - dayOfWeek: "Monday", - startHourUtc: 12, - maintenanceWindow: "PT5H", - }, - { - dayOfWeek: "Tuesday", - startHourUtc: 12, - }, - ], + properties: { + scheduleEntries: [ + { + dayOfWeek: "Monday", + startHourUtc: 12, + maintenanceWindow: "PT5H", + }, + { + dayOfWeek: "Tuesday", + startHourUtc: 12, + }, + ], + }, }); assert.equal(res.type, "Microsoft.Cache/Redis/PatchSchedules"); }); @@ -184,14 +189,15 @@ describe("Redis test", () => { while (count < 20) { count++; const redisResponse = await client.redis.get(resourceGroupName, name); - if (redisResponse.provisioningState === "Succeeded") { - const updateResult = await client.redis.beginUpdateAndWait( + if (redisResponse.properties.provisioningState === "Succeeded") { + const poller = client.redis.update( resourceGroupName, name, - { enableNonSslPort: true }, + { properties: { enableNonSslPort: true } }, testPollingOptions, ); - assert.equal(updateResult.enableNonSslPort, true); + const updateResult = await poller.pollUntilDone(); + assert.equal(updateResult.properties.enableNonSslPort, true); break; } else { // The resource is activating @@ -206,7 +212,8 @@ describe("Redis test", () => { }); it("redis delete test", async () => { - await client.redis.beginDeleteAndWait(resourceGroupName, name, testPollingOptions); + const poller = client.redis.delete(resourceGroupName, name, testPollingOptions); + await poller.pollUntilDone(); const resArray = new Array(); for await (const item of client.redis.listByResourceGroup(resourceGroupName)) { resArray.push(item); diff --git a/sdk/redis/arm-rediscache/test/snippets.spec.ts b/sdk/redis/arm-rediscache/test/snippets.spec.ts index 10c48b0ba1ce..3c5f19a63568 100644 --- a/sdk/redis/arm-rediscache/test/snippets.spec.ts +++ b/sdk/redis/arm-rediscache/test/snippets.spec.ts @@ -13,11 +13,11 @@ describe("snippets", () => { }); it("ReadmeSampleCreateClient_Browser", async () => { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; const credential = new InteractiveBrowserCredential({ tenantId: "", clientId: "", }); + const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new RedisManagementClient(credential, subscriptionId); }); diff --git a/sdk/redis/arm-rediscache/tsconfig.json b/sdk/redis/arm-rediscache/tsconfig.json index d466f1460665..0e57dbd186e5 100644 --- a/sdk/redis/arm-rediscache/tsconfig.json +++ b/sdk/redis/arm-rediscache/tsconfig.json @@ -12,6 +12,5 @@ { "path": "./tsconfig.snippets.json" } - ], - "files": [] + ] } diff --git a/sdk/redis/arm-rediscache/tsconfig.test.json b/sdk/redis/arm-rediscache/tsconfig.test.json index 42798ad68913..290ca214aebc 100644 --- a/sdk/redis/arm-rediscache/tsconfig.test.json +++ b/sdk/redis/arm-rediscache/tsconfig.test.json @@ -1,14 +1,3 @@ { - "references": [ - { - "path": "./tsconfig.test.node.json" - }, - { - "path": "./tsconfig.browser.config.json" - } - ], - "compilerOptions": { - "composite": true - }, - "files": [] + "extends": ["./tsconfig.src.json", "../../../tsconfig.test.base.json"] } diff --git a/sdk/redis/arm-rediscache/tsconfig.test.node.json b/sdk/redis/arm-rediscache/tsconfig.test.node.json deleted file mode 100644 index 9d9d9452a351..000000000000 --- a/sdk/redis/arm-rediscache/tsconfig.test.node.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.test.node.base.json", - "compilerOptions": { - "paths": { - "@azure/arm-rediscache": ["./src/index.ts"], - "@azure/arm-rediscache/*": ["./src/*"], - "$internal/*": ["./src/*"] - } - } -} diff --git a/sdk/redis/arm-rediscache/tsp-location.yaml b/sdk/redis/arm-rediscache/tsp-location.yaml new file mode 100644 index 000000000000..1a726130b37c --- /dev/null +++ b/sdk/redis/arm-rediscache/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/redis/resource-manager/Microsoft.Cache/Redis +commit: c6b8ccf2f40e20d281691eac653cb98c1ef60d49 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/redis/arm-rediscache/vitest.esm.config.ts b/sdk/redis/arm-rediscache/vitest.esm.config.ts new file mode 100644 index 000000000000..5e9735e9b144 --- /dev/null +++ b/sdk/redis/arm-rediscache/vitest.esm.config.ts @@ -0,0 +1,8 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import { mergeConfig } from "vitest/config"; +import vitestConfig from "./vitest.config.ts"; +import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; + +export default mergeConfig(vitestConfig, vitestEsmConfig); diff --git a/sdk/redis/ci.mgmt.yml b/sdk/redis/ci.mgmt.yml index 90153daf2719..a683d07f54e2 100644 --- a/sdk/redis/ci.mgmt.yml +++ b/sdk/redis/ci.mgmt.yml @@ -1,11 +1,13 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - + trigger: branches: include: - main - release/* - hotfix/* + exclude: + - feature/v4 paths: include: - sdk/redis/ci.mgmt.yml