From 07835390bf2732b087f19d896fa3e0a7a6cd4e9f Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Thu, 19 Mar 2026 10:03:52 +0000 Subject: [PATCH] Configurations: 'specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/tspconfig.yaml', API Version: 2025-08-01-preview, SDK Release Type: beta, and CommitSHA: 'aa822c9c01b9e83fbc8ad8ec4c308203a3c29287' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6034410 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --- .../armredisenterprise/CHANGELOG.md | 56 + .../armredisenterprise/README.md | 2 +- .../accesspolicyassignment_client.go | 29 +- ...esspolicyassignment_client_example_test.go | 140 +-- .../armredisenterprise/autorest.md | 13 - .../armredisenterprise/build.go | 7 - .../armredisenterprise/client.go | 94 +- .../armredisenterprise/client_example_test.go | 607 +++++++---- .../armredisenterprise/client_factory.go | 13 +- .../armredisenterprise/constants.go | 438 ++++++-- .../armredisenterprise/databases_client.go | 204 ++-- .../databases_client_example_test.go | 692 +++++++------ .../fake/accesspolicyassignment_server.go | 5 +- .../fake/databases_server.go | 5 +- .../armredisenterprise/fake/internal.go | 11 +- .../fake/migration_server.go | 281 +++++ .../fake/operations_server.go | 5 +- .../fake/operationsstatus_server.go | 5 +- .../fake/privateendpointconnections_server.go | 9 +- .../fake/privatelinkresources_server.go | 9 +- .../armredisenterprise/fake/server.go | 5 +- .../armredisenterprise/fake/server_factory.go | 32 +- .../redisenterprise/armredisenterprise/go.mod | 12 +- .../redisenterprise/armredisenterprise/go.sum | 20 +- .../armredisenterprise/interfaces.go | 14 + .../armredisenterprise/migration_client.go | 327 ++++++ .../migration_client_example_test.go | 168 +++ .../armredisenterprise/models.go | 504 +++++---- .../armredisenterprise/models_serde.go | 965 +++++++++--------- .../armredisenterprise/operations_client.go | 9 +- .../operations_client_example_test.go | 52 +- .../operations_live_test.go | 2 +- .../operationsstatus_client.go | 21 +- .../operationsstatus_client_example_test.go | 27 +- .../armredisenterprise/options.go | 25 +- .../armredisenterprise/polymorphic_helpers.go | 28 + .../privateendpointconnections_client.go | 85 +- ...endpointconnections_client_example_test.go | 189 ++-- .../privatelinkresources_client.go | 34 +- ...rivatelinkresources_client_example_test.go | 44 +- .../redisenterprise_live_test.go | 2 +- .../armredisenterprise/responses.go | 30 +- .../testdata/_metadata.json | 6 + .../armredisenterprise/time_rfc3339.go | 110 -- .../armredisenterprise/tsp-location.yaml | 4 + .../armredisenterprise/version.go | 2 +- 46 files changed, 3251 insertions(+), 2091 deletions(-) delete mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/autorest.md delete mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/build.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/fake/migration_server.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/interfaces.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client_example_test.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/polymorphic_helpers.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/testdata/_metadata.json delete mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/time_rfc3339.go create mode 100644 sdk/resourcemanager/redisenterprise/armredisenterprise/tsp-location.yaml diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/CHANGELOG.md b/sdk/resourcemanager/redisenterprise/armredisenterprise/CHANGELOG.md index e69c91aac4ca..9ce33f5f0636 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/CHANGELOG.md +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/CHANGELOG.md @@ -1,5 +1,61 @@ # Release History +## 4.0.0-beta.1 (2026-03-19) +### Breaking Changes + +- Type of `ClusterCreateProperties.Encryption` has been changed from `*ClusterCommonPropertiesEncryption` to `*ClusterPropertiesEncryption` +- Type of `ClusterUpdateProperties.Encryption` has been changed from `*ClusterCommonPropertiesEncryption` to `*ClusterPropertiesEncryption` +- Type of `DatabaseCreateProperties.GeoReplication` has been changed from `*DatabaseCommonPropertiesGeoReplication` to `*DatabasePropertiesGeoReplication` +- Type of `DatabaseUpdateProperties.GeoReplication` has been changed from `*DatabaseCommonPropertiesGeoReplication` to `*DatabasePropertiesGeoReplication` +- Struct `ClusterCommonProperties` has been removed +- Struct `ClusterCommonPropertiesEncryption` has been removed +- Struct `ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption` has been removed +- Struct `ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity` has been removed +- Struct `DatabaseCommonProperties` has been removed +- Struct `DatabaseCommonPropertiesGeoReplication` has been removed +- Struct `ErrorDetailAutoGenerated` has been removed +- Struct `ErrorResponseAutoGenerated` has been removed +- Struct `ProxyResource` has been removed +- Struct `ProxyResourceAutoGenerated` has been removed +- Struct `Resource` has been removed +- Struct `ResourceAutoGenerated` has been removed +- Struct `TrackedResource` has been removed + +### Features Added + +- New enum type `MaintenanceDayOfWeek` with values `MaintenanceDayOfWeekFriday`, `MaintenanceDayOfWeekMonday`, `MaintenanceDayOfWeekSaturday`, `MaintenanceDayOfWeekSunday`, `MaintenanceDayOfWeekThursday`, `MaintenanceDayOfWeekTuesday`, `MaintenanceDayOfWeekWednesday` +- New enum type `MaintenanceWindowType` with values `MaintenanceWindowTypeWeekly` +- New enum type `MigrationProvisioningState` with values `MigrationProvisioningStateAccepted`, `MigrationProvisioningStateCancelled`, `MigrationProvisioningStateCancelling`, `MigrationProvisioningStateFailed`, `MigrationProvisioningStateInProgress`, `MigrationProvisioningStateReadyForDNSSwitch`, `MigrationProvisioningStateSucceeded` +- New enum type `SourceType` with values `SourceTypeAzureCacheForRedis` +- New function `*AzureCacheForRedisMigrationProperties.GetMigrationProperties() *MigrationProperties` +- New function `*ClientFactory.NewMigrationClient() *MigrationClient` +- New function `NewMigrationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationClient, error)` +- New function `*MigrationClient.BeginCancel(ctx context.Context, resourceGroupName string, clusterName string, options *MigrationClientBeginCancelOptions) (*runtime.Poller[MigrationClientCancelResponse], error)` +- New function `*MigrationClient.Get(ctx context.Context, resourceGroupName string, clusterName string, options *MigrationClientGetOptions) (MigrationClientGetResponse, error)` +- New function `*MigrationClient.NewListPager(resourceGroupName string, clusterName string, options *MigrationClientListOptions) *runtime.Pager[MigrationClientListResponse]` +- New function `*MigrationClient.BeginStart(ctx context.Context, resourceGroupName string, clusterName string, parameters Migration, options *MigrationClientBeginStartOptions) (*runtime.Poller[MigrationClientStartResponse], error)` +- New function `*MigrationProperties.GetMigrationProperties() *MigrationProperties` +- New struct `AzureCacheForRedisMigrationProperties` +- New struct `ClusterPropertiesEncryption` +- New struct `ClusterPropertiesEncryptionCustomerManagedKeyEncryption` +- New struct `ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity` +- New struct `DatabasePropertiesGeoReplication` +- New struct `MaintenanceConfiguration` +- New struct `MaintenanceWindow` +- New struct `MaintenanceWindowSchedule` +- New struct `Migration` +- New struct `MigrationList` +- New field `SystemData` in struct `AccessPolicyAssignment` +- New field `SystemData` in struct `Cluster` +- New field `MaintenanceConfiguration` in struct `ClusterCreateProperties` +- New field `MaintenanceConfiguration` in struct `ClusterUpdateProperties` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New field `NextLink` in struct `PrivateEndpointConnectionListResult` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `SystemData` in struct `PrivateLinkResource` +- New field `NextLink` in struct `PrivateLinkResourceListResult` + + ## 3.0.0 (2025-10-17) ### Breaking Changes diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/README.md b/sdk/resourcemanager/redisenterprise/armredisenterprise/README.md index 2eccbec34188..e33a994acc7d 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/README.md +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/README.md @@ -18,7 +18,7 @@ This project uses [Go modules](https://github.com/golang/go/wiki/Modules) for ve Install the Azure Redis Enterprise module: ```sh -go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3 +go get github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4 ``` ## Authorization diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client.go index 9246b5788339..9e2fcedf9077 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -25,9 +24,9 @@ type AccessPolicyAssignmentClient struct { } // NewAccessPolicyAssignmentClient creates a new instance of AccessPolicyAssignmentClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewAccessPolicyAssignmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccessPolicyAssignmentClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,7 +42,7 @@ func NewAccessPolicyAssignmentClient(subscriptionID string, credential azcore.To // BeginCreateUpdate - Creates/Updates a particular access policy assignment for a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -73,7 +72,7 @@ func (client *AccessPolicyAssignmentClient) BeginCreateUpdate(ctx context.Contex // CreateUpdate - Creates/Updates a particular access policy assignment for a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *AccessPolicyAssignmentClient) createUpdate(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, parameters AccessPolicyAssignment, options *AccessPolicyAssignmentClientBeginCreateUpdateOptions) (*http.Response, error) { var err error const operationName = "AccessPolicyAssignmentClient.BeginCreateUpdate" @@ -123,9 +122,10 @@ func (client *AccessPolicyAssignmentClient) createUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -135,7 +135,7 @@ func (client *AccessPolicyAssignmentClient) createUpdateCreateRequest(ctx contex // BeginDelete - Deletes a single access policy assignment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -164,7 +164,7 @@ func (client *AccessPolicyAssignmentClient) BeginDelete(ctx context.Context, res // Delete - Deletes a single access policy assignment. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *AccessPolicyAssignmentClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, accessPolicyAssignmentName string, options *AccessPolicyAssignmentClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "AccessPolicyAssignmentClient.BeginDelete" @@ -214,16 +214,15 @@ func (client *AccessPolicyAssignmentClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about access policy assignment for database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -281,7 +280,7 @@ func (client *AccessPolicyAssignmentClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -298,7 +297,7 @@ func (client *AccessPolicyAssignmentClient) getHandleResponse(resp *http.Respons // NewListPager - Gets all access policy assignments.. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -352,7 +351,7 @@ func (client *AccessPolicyAssignmentClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client_example_test.go index 5818384b7e26..5ad9e33b7584 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/accesspolicyassignment_client_example_test.go @@ -1,28 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseAccessPolicyAssignmentCreateUpdate.json func ExampleAccessPolicyAssignmentClient_BeginCreateUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -44,81 +41,85 @@ func ExampleAccessPolicyAssignmentClient_BeginCreateUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessPolicyAssignment = armredisenterprise.AccessPolicyAssignment{ - // Name: to.Ptr("defaultTestEntraApp1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/accessPolicyAssignments"), - // ID: to.Ptr("subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroupsrg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default/accessPolicyAssignments/default-TestEntraApp1"), - // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("default"), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // res = armredisenterprise.AccessPolicyAssignmentClientCreateUpdateResponse{ + // AccessPolicyAssignment: &armredisenterprise.AccessPolicyAssignment{ + // Name: to.Ptr("defaultTestEntraApp1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/accessPolicyAssignments"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default/accessPolicyAssignments/default-TestEntraApp1"), + // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ + // AccessPolicyName: to.Ptr("default"), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ + // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // }, // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseAccessPolicyAssignmentGet.json -func ExampleAccessPolicyAssignmentClient_Get() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseAccessPolicyAssignmentDelete.json +func ExampleAccessPolicyAssignmentClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewAccessPolicyAssignmentClient().Get(ctx, "rg1", "cache1", "default", "accessPolicyAssignmentName1", nil) + poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginDelete(ctx, "rg1", "cache1", "default", "defaultTestEntraApp1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessPolicyAssignment = armredisenterprise.AccessPolicyAssignment{ - // Name: to.Ptr("accessPolicyAssignmentName1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), - // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("default"), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), - // }, - // }, - // } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseAccessPolicyAssignmentDelete.json -func ExampleAccessPolicyAssignmentClient_BeginDelete() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseAccessPolicyAssignmentGet.json +func ExampleAccessPolicyAssignmentClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewAccessPolicyAssignmentClient().BeginDelete(ctx, "rg1", "cache1", "default", "defaultTestEntraApp1", nil) + res, err := clientFactory.NewAccessPolicyAssignmentClient().Get(ctx, "rg1", "cache1", "default", "accessPolicyAssignmentName1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.AccessPolicyAssignmentClientGetResponse{ + // AccessPolicyAssignment: &armredisenterprise.AccessPolicyAssignment{ + // Name: to.Ptr("accessPolicyAssignmentName1"), + // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), + // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ + // AccessPolicyName: to.Ptr("default"), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ + // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // }, + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseAccessPolicyAssignmentsList.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseAccessPolicyAssignmentsList.json func ExampleAccessPolicyAssignmentClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -133,32 +134,35 @@ func ExampleAccessPolicyAssignmentClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.AccessPolicyAssignmentList = armredisenterprise.AccessPolicyAssignmentList{ - // Value: []*armredisenterprise.AccessPolicyAssignment{ - // { - // Name: to.Ptr("accessPolicyAssignmentName1"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), - // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("default"), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ - // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // page = armredisenterprise.AccessPolicyAssignmentClientListResponse{ + // AccessPolicyAssignmentList: armredisenterprise.AccessPolicyAssignmentList{ + // Value: []*armredisenterprise.AccessPolicyAssignment{ + // { + // Name: to.Ptr("accessPolicyAssignmentName1"), + // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName1"), + // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ + // AccessPolicyName: to.Ptr("default"), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ + // ObjectID: to.Ptr("6497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // }, // }, // }, - // }, - // { - // Name: to.Ptr("accessPolicyAssignmentName2"), - // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName2"), - // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ - // AccessPolicyName: to.Ptr("default"), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ - // ObjectID: to.Ptr("7497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // { + // Name: to.Ptr("accessPolicyAssignmentName2"), + // Type: to.Ptr("Microsoft.Cache/Redis/accessPolicyAssignments"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1/accessPolicyAssignments/accessPolicyAssignmentName2"), + // Properties: &armredisenterprise.AccessPolicyAssignmentProperties{ + // AccessPolicyName: to.Ptr("default"), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // User: &armredisenterprise.AccessPolicyAssignmentPropertiesUser{ + // ObjectID: to.Ptr("7497c918-11ad-41e7-1b0f-7c518a87d0b0"), + // }, // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/autorest.md b/sdk/resourcemanager/redisenterprise/armredisenterprise/autorest.md deleted file mode 100644 index 16c4b2197b9a..000000000000 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/autorest.md +++ /dev/null @@ -1,13 +0,0 @@ -### AutoRest Configuration - -> see https://aka.ms/autorest - -``` yaml -azure-arm: true -require: -- https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/readme.go.md -license-header: MICROSOFT_MIT_NO_VERSION -module-version: 3.0.0 -tag: package-2025-07-01 -``` \ No newline at end of file diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/build.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/build.go deleted file mode 100644 index 1bff1436d445..000000000000 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/build.go +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - -// This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -skipBuild -cleanGenerated -format -tidy -generate resourcemanager/redisenterprise/armredisenterprise - -package armredisenterprise diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/client.go index 57d2e67010d1..b473be71c98e 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -17,7 +16,7 @@ import ( "strings" ) -// Client contains the methods for the RedisEnterprise group. +// Client contains the methods for the service. // Don't use this type directly, use NewClient() instead. type Client struct { internal *arm.Client @@ -25,9 +24,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,7 +42,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginCreate - Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -70,7 +69,7 @@ func (client *Client) BeginCreate(ctx context.Context, resourceGroupName string, // Create - Creates or updates an existing (overwrite/recreate, with potential downtime) cache cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *Client) create(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, options *ClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginCreate" @@ -95,6 +94,10 @@ func (client *Client) create(ctx context.Context, resourceGroupName string, clus // createCreateRequest creates the Create request. func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster, _ *ClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -103,18 +106,15 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -124,7 +124,7 @@ func (client *Client) createCreateRequest(ctx context.Context, resourceGroupName // BeginDelete - Deletes a Redis Enterprise cache cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -150,7 +150,7 @@ func (client *Client) BeginDelete(ctx context.Context, resourceGroupName string, // Delete - Deletes a Redis Enterprise cache cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *Client) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, options *ClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "Client.BeginDelete" @@ -175,6 +175,10 @@ func (client *Client) deleteOperation(ctx context.Context, resourceGroupName str // deleteCreateRequest creates the Delete request. func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -183,25 +187,20 @@ func (client *Client) deleteCreateRequest(ctx context.Context, resourceGroupName return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets information about a Redis Enterprise cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -231,6 +230,10 @@ func (client *Client) Get(ctx context.Context, resourceGroupName string, cluster // getCreateRequest creates the Get request. func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -239,16 +242,12 @@ func (client *Client) getCreateRequest(ctx context.Context, resourceGroupName st return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -265,7 +264,7 @@ func (client *Client) getHandleResponse(resp *http.Response) (ClientGetResponse, // NewListPager - Lists all Redis Enterprise clusters in the specified subscription. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - options - ClientListOptions contains the optional parameters for the Client.NewListPager method. func (client *Client) NewListPager(options *ClientListOptions) *runtime.Pager[ClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ClientListResponse]{ @@ -302,7 +301,7 @@ func (client *Client) listCreateRequest(ctx context.Context, _ *ClientListOption return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -319,7 +318,7 @@ func (client *Client) listHandleResponse(resp *http.Response) (ClientListRespons // NewListByResourceGroupPager - Lists all Redis Enterprise clusters in a resource group. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ClientListByResourceGroupOptions contains the optional parameters for the Client.NewListByResourceGroupPager // method. @@ -349,20 +348,20 @@ func (client *Client) NewListByResourceGroupPager(resourceGroupName string, opti // listByResourceGroupCreateRequest creates the ListByResourceGroup request. func (client *Client) listByResourceGroupCreateRequest(ctx context.Context, resourceGroupName string, _ *ClientListByResourceGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise" - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,7 +379,7 @@ func (client *Client) listByResourceGroupHandleResponse(resp *http.Response) (Cl // ListSKUsForScaling - Lists the available SKUs for scaling the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -410,6 +409,10 @@ func (client *Client) ListSKUsForScaling(ctx context.Context, resourceGroupName // listSKUsForScalingCreateRequest creates the ListSKUsForScaling request. func (client *Client) listSKUsForScalingCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *ClientListSKUsForScalingOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/listSkusForScaling" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -418,16 +421,12 @@ func (client *Client) listSKUsForScalingCreateRequest(ctx context.Context, resou return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -445,7 +444,7 @@ func (client *Client) listSKUsForScalingHandleResponse(resp *http.Response) (Cli // BeginUpdate - Updates an existing Redis Enterprise cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -472,7 +471,7 @@ func (client *Client) BeginUpdate(ctx context.Context, resourceGroupName string, // Update - Updates an existing Redis Enterprise cluster // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *Client) update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, options *ClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "Client.BeginUpdate" @@ -497,6 +496,10 @@ func (client *Client) update(ctx context.Context, resourceGroupName string, clus // updateCreateRequest creates the Update request. func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterUpdate, _ *ClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -505,18 +508,15 @@ func (client *Client) updateCreateRequest(ctx context.Context, resourceGroupName return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/client_example_test.go index 2d4ccd44e22f..86a4e4b95f71 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/client_example_test.go @@ -1,46 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseCreate.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseCreate.json func ExampleClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewClient().BeginCreate(ctx, "rg1", "cache1", armredisenterprise.Cluster{ - Location: to.Ptr("West US"), - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, Identity: &armredisenterprise.ManagedServiceIdentity{ Type: to.Ptr(armredisenterprise.ManagedServiceIdentityTypeUserAssigned), UserAssignedIdentities: map[string]*armredisenterprise.UserAssignedIdentity{ "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity": {}, }, }, + Location: to.Ptr("West US"), Properties: &armredisenterprise.ClusterCreateProperties{ - Encryption: &armredisenterprise.ClusterCommonPropertiesEncryption{ - CustomerManagedKeyEncryption: &armredisenterprise.ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption{ - KeyEncryptionKeyIdentity: &armredisenterprise.ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity{ + Encryption: &armredisenterprise.ClusterPropertiesEncryption{ + CustomerManagedKeyEncryption: &armredisenterprise.ClusterPropertiesEncryptionCustomerManagedKeyEncryption{ + KeyEncryptionKeyIdentity: &armredisenterprise.ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity{ IdentityType: to.Ptr(armredisenterprise.CmkIdentityTypeUserAssignedIdentity), UserAssignedIdentityResourceID: to.Ptr("/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity"), }, @@ -49,15 +43,47 @@ func ExampleClient_BeginCreate() { }, MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), + MaintenanceConfiguration: &armredisenterprise.MaintenanceConfiguration{ + MaintenanceWindows: []*armredisenterprise.MaintenanceWindow{ + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekMonday), + }, + }, + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekTuesday), + }, + }, + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekWednesday), + }, + }, + }, + }, }, SKU: &armredisenterprise.SKU{ Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), Capacity: to.Ptr[int32](3), }, + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + }, Zones: []*string{ to.Ptr("1"), to.Ptr("2"), - to.Ptr("3")}, + to.Ptr("3"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -69,67 +95,86 @@ func ExampleClient_BeginCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armredisenterprise.Cluster{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // }, - // Identity: &armredisenterprise.ManagedServiceIdentity{ - // Type: to.Ptr(armredisenterprise.ManagedServiceIdentityTypeUserAssigned), - // UserAssignedIdentities: map[string]*armredisenterprise.UserAssignedIdentity{ - // "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity": &armredisenterprise.UserAssignedIdentity{ - // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // res = armredisenterprise.ClientCreateResponse{ + // Cluster: &armredisenterprise.Cluster{ + // Name: to.Ptr("cache1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // Identity: &armredisenterprise.ManagedServiceIdentity{ + // Type: to.Ptr(armredisenterprise.ManagedServiceIdentityTypeUserAssigned), + // UserAssignedIdentities: map[string]*armredisenterprise.UserAssignedIdentity{ + // "/subscriptions/your-subscription/resourceGroups/your-rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/your-identity": &armredisenterprise.UserAssignedIdentity{ + // ClientID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // PrincipalID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, // }, // }, + // Kind: to.Ptr(armredisenterprise.KindV1), + // Location: to.Ptr("West US"), + // Properties: &armredisenterprise.ClusterCreateProperties{ + // HostName: to.Ptr("cache1.westus.something.azure.net"), + // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), + // MaintenanceConfiguration: &armredisenterprise.MaintenanceConfiguration{ + // MaintenanceWindows: []*armredisenterprise.MaintenanceWindow{ + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekMonday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekTuesday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekWednesday), + // }, + // }, + // }, + // }, + // RedisVersion: to.Ptr("5"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // SKU: &armredisenterprise.SKU{ + // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + // Capacity: to.Ptr[int32](3), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, // }, - // Kind: to.Ptr(armredisenterprise.KindV1), - // Properties: &armredisenterprise.ClusterCreateProperties{ - // HostName: to.Ptr("cache1.westus.something.azure.net"), - // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("5"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), - // }, - // SKU: &armredisenterprise.SKU{ - // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - // Capacity: to.Ptr[int32](3), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseUpdate.json -func ExampleClient_BeginUpdate() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDelete.json +func ExampleClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewClient().BeginUpdate(ctx, "rg1", "cache1", armredisenterprise.ClusterUpdate{ - Properties: &armredisenterprise.ClusterUpdateProperties{ - MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessEnabled), - }, - SKU: &armredisenterprise.SKU{ - Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - Capacity: to.Ptr[int32](9), - }, - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - }, - }, nil) + poller, err := clientFactory.NewClient().BeginDelete(ctx, "rg1", "cache1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -140,66 +185,18 @@ func ExampleClient_BeginUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armredisenterprise.Cluster{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // "tag1": to.Ptr("value1"), - // }, - // Identity: &armredisenterprise.ManagedServiceIdentity{ - // Type: to.Ptr(armredisenterprise.ManagedServiceIdentityTypeNone), - // }, - // Kind: to.Ptr(armredisenterprise.KindV1), - // Properties: &armredisenterprise.ClusterCreateProperties{ - // HostName: to.Ptr("cache1.westus.something.azure.com"), - // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("5"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), - // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessEnabled), - // }, - // SKU: &armredisenterprise.SKU{ - // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - // Capacity: to.Ptr[int32](9), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDelete.json -func ExampleClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().BeginDelete(ctx, "rg1", "cache1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } + // res = armredisenterprise.ClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseGet.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseGet.json func ExampleClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -210,59 +207,91 @@ func ExampleClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Cluster = armredisenterprise.Cluster{ - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr(armredisenterprise.KindV1), - // Properties: &armredisenterprise.ClusterCreateProperties{ - // HostName: to.Ptr("cache1.westus.something.azure.com"), - // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - // PrivateEndpointConnections: []*armredisenterprise.PrivateEndpointConnection{ - // { - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/cachePec"), - // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/cachePe"), + // res = armredisenterprise.ClientGetResponse{ + // Cluster: &armredisenterprise.Cluster{ + // Name: to.Ptr("cache1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // Kind: to.Ptr(armredisenterprise.KindV1), + // Location: to.Ptr("West US"), + // Properties: &armredisenterprise.ClusterCreateProperties{ + // HostName: to.Ptr("cache1.westus.something.azure.com"), + // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + // PrivateEndpointConnections: []*armredisenterprise.PrivateEndpointConnection{ + // { + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/cachePec"), + // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/cachePe"), + // }, + // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Please approve my connection"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // }, // }, - // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Please approve my connection"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // }, + // }, + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), + // MaintenanceConfiguration: &armredisenterprise.MaintenanceConfiguration{ + // MaintenanceWindows: []*armredisenterprise.MaintenanceWindow{ + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekMonday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekTuesday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekWednesday), + // }, // }, // }, - // }}, - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), - // }, - // SKU: &armredisenterprise.SKU{ - // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - // Capacity: to.Ptr[int32](3), + // }, + // RedisVersion: to.Ptr("6"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // SKU: &armredisenterprise.SKU{ + // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + // Capacity: to.Ptr[int32](3), + // }, + // Tags: map[string]*string{ + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // } + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseListByResourceGroup.json -func ExampleClient_NewListByResourceGroupPager() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseList.json +func ExampleClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewClient().NewListByResourceGroupPager("rg1", nil) + pager := clientFactory.NewClient().NewListPager(nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -273,49 +302,48 @@ func ExampleClient_NewListByResourceGroupPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterList = armredisenterprise.ClusterList{ - // Value: []*armredisenterprise.Cluster{ - // { - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ + // page = armredisenterprise.ClientListResponse{ + // ClusterList: armredisenterprise.ClusterList{ + // Value: []*armredisenterprise.Cluster{ + // { + // Name: to.Ptr("cache1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // Kind: to.Ptr(armredisenterprise.KindV1), + // Location: to.Ptr("West US"), + // Properties: &armredisenterprise.ClusterCreateProperties{ + // HostName: to.Ptr("cache1.westus.something.azure.com"), + // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), + // RedisVersion: to.Ptr("6"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // SKU: &armredisenterprise.SKU{ + // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + // Capacity: to.Ptr[int32](3), + // }, + // Tags: map[string]*string{ + // }, // }, - // Kind: to.Ptr(armredisenterprise.KindV1), - // Properties: &armredisenterprise.ClusterCreateProperties{ - // HostName: to.Ptr("cache1.westus.something.azure.com"), - // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("5"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), - // }, - // SKU: &armredisenterprise.SKU{ - // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - // Capacity: to.Ptr[int32](3), - // }, - // Zones: []*string{ - // to.Ptr("1"), - // to.Ptr("2"), - // to.Ptr("3")}, - // }}, - // } + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseList.json -func ExampleClient_NewListPager() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseListByResourceGroup.json +func ExampleClient_NewListByResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewClient().NewListPager(nil) + pager := clientFactory.NewClient().NewListByResourceGroupPager("rg1", nil) for pager.More() { page, err := pager.NextPage(ctx) if err != nil { @@ -326,41 +354,49 @@ func ExampleClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClusterList = armredisenterprise.ClusterList{ - // Value: []*armredisenterprise.Cluster{ - // { - // Name: to.Ptr("cache1"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), - // Location: to.Ptr("West US"), - // Tags: map[string]*string{ - // }, - // Kind: to.Ptr(armredisenterprise.KindV1), - // Properties: &armredisenterprise.ClusterCreateProperties{ - // HostName: to.Ptr("cache1.westus.something.azure.com"), - // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), - // }, - // SKU: &armredisenterprise.SKU{ - // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), - // Capacity: to.Ptr[int32](3), + // page = armredisenterprise.ClientListByResourceGroupResponse{ + // ClusterList: armredisenterprise.ClusterList{ + // Value: []*armredisenterprise.Cluster{ + // { + // Name: to.Ptr("cache1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // Kind: to.Ptr(armredisenterprise.KindV1), + // Location: to.Ptr("West US"), + // Properties: &armredisenterprise.ClusterCreateProperties{ + // HostName: to.Ptr("cache1.westus.something.azure.com"), + // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessDisabled), + // RedisVersion: to.Ptr("5"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // SKU: &armredisenterprise.SKU{ + // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + // Capacity: to.Ptr[int32](3), + // }, + // Tags: map[string]*string{ + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, // }, - // }}, + // }, + // }, // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseListSkusForScaling.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseListSkusForScaling.json func ExampleClient_ListSKUsForScaling() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -371,19 +407,146 @@ func ExampleClient_ListSKUsForScaling() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.SKUDetailsList = armredisenterprise.SKUDetailsList{ - // SKUs: []*armredisenterprise.SKUDetails{ - // { - // Name: to.Ptr("MemoryOptimized_M100"), - // SizeInGB: to.Ptr[float32](120), + // res = armredisenterprise.ClientListSKUsForScalingResponse{ + // SKUDetailsList: &armredisenterprise.SKUDetailsList{ + // SKUs: []*armredisenterprise.SKUDetails{ + // { + // Name: to.Ptr("MemoryOptimized_M100"), + // SizeInGB: to.Ptr[float32](120), + // }, + // { + // Name: to.Ptr("ComputeOptimized_X700"), + // SizeInGB: to.Ptr[float32](720), + // }, + // { + // Name: to.Ptr("Balanced_B5"), + // SizeInGB: to.Ptr[float32](6), + // }, + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseUpdate.json +func ExampleClient_BeginUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewClient().BeginUpdate(ctx, "rg1", "cache1", armredisenterprise.ClusterUpdate{ + Properties: &armredisenterprise.ClusterUpdateProperties{ + MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessEnabled), + MaintenanceConfiguration: &armredisenterprise.MaintenanceConfiguration{ + MaintenanceWindows: []*armredisenterprise.MaintenanceWindow{ + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekMonday), + }, + }, + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekTuesday), + }, + }, + { + Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + Duration: to.Ptr("PT6H"), + StartHourUTC: to.Ptr[int32](3), + Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekWednesday), + }, + }, + }, + }, + }, + SKU: &armredisenterprise.SKU{ + Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + Capacity: to.Ptr[int32](9), + }, + Tags: map[string]*string{ + "tag1": to.Ptr("value1"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.ClientUpdateResponse{ + // Cluster: &armredisenterprise.Cluster{ + // Name: to.Ptr("cache1"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // Identity: &armredisenterprise.ManagedServiceIdentity{ + // Type: to.Ptr(armredisenterprise.ManagedServiceIdentityTypeNone), // }, - // { - // Name: to.Ptr("ComputeOptimized_X700"), - // SizeInGB: to.Ptr[float32](720), + // Kind: to.Ptr(armredisenterprise.KindV1), + // Location: to.Ptr("West US"), + // Properties: &armredisenterprise.ClusterCreateProperties{ + // HostName: to.Ptr("cache1.westus.something.azure.com"), + // MinimumTLSVersion: to.Ptr(armredisenterprise.TLSVersionOne2), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // PublicNetworkAccess: to.Ptr(armredisenterprise.PublicNetworkAccessEnabled), + // MaintenanceConfiguration: &armredisenterprise.MaintenanceConfiguration{ + // MaintenanceWindows: []*armredisenterprise.MaintenanceWindow{ + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekMonday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekTuesday), + // }, + // }, + // { + // Type: to.Ptr(armredisenterprise.MaintenanceWindowTypeWeekly), + // Duration: to.Ptr("PT6H"), + // StartHourUTC: to.Ptr[int32](3), + // Schedule: &armredisenterprise.MaintenanceWindowSchedule{ + // DayOfWeek: to.Ptr(armredisenterprise.MaintenanceDayOfWeekWednesday), + // }, + // }, + // }, + // }, + // RedisVersion: to.Ptr("5"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), // }, - // { - // Name: to.Ptr("Balanced_B5"), - // SizeInGB: to.Ptr[float32](6), - // }}, + // SKU: &armredisenterprise.SKU{ + // Name: to.Ptr(armredisenterprise.SKUNameEnterpriseFlashF300), + // Capacity: to.Ptr[int32](9), + // }, + // Tags: map[string]*string{ + // "tag1": to.Ptr("value1"), + // }, + // Zones: []*string{ + // to.Ptr("1"), + // to.Ptr("2"), + // to.Ptr("3"), + // }, + // }, // } } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/client_factory.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/client_factory.go index b666fb55519d..7d1f4df1dedf 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/client_factory.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/client_factory.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -19,7 +18,7 @@ type ClientFactory struct { // NewClientFactory creates a new instance of ClientFactory with the specified values. // The parameter values will be propagated to any client created from this factory. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. // - options - pass nil to accept the default values. func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) { @@ -57,6 +56,14 @@ func (c *ClientFactory) NewDatabasesClient() *DatabasesClient { } } +// NewMigrationClient creates a new instance of MigrationClient. +func (c *ClientFactory) NewMigrationClient() *MigrationClient { + return &MigrationClient{ + subscriptionID: c.subscriptionID, + internal: c.internal, + } +} + // NewOperationsClient creates a new instance of OperationsClient. func (c *ClientFactory) NewOperationsClient() *OperationsClient { return &OperationsClient{ diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/constants.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/constants.go index 29e4e4a60839..33ad1175542f 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/constants.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/constants.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -9,7 +8,9 @@ package armredisenterprise type AccessKeyType string const ( - AccessKeyTypePrimary AccessKeyType = "Primary" + // AccessKeyTypePrimary - Primary + AccessKeyTypePrimary AccessKeyType = "Primary" + // AccessKeyTypeSecondary - Secondary AccessKeyTypeSecondary AccessKeyType = "Secondary" ) @@ -26,8 +27,10 @@ func PossibleAccessKeyTypeValues() []AccessKeyType { type AccessKeysAuthentication string const ( + // AccessKeysAuthenticationDisabled - Disabled AccessKeysAuthenticationDisabled AccessKeysAuthentication = "Disabled" - AccessKeysAuthenticationEnabled AccessKeysAuthentication = "Enabled" + // AccessKeysAuthenticationEnabled - Enabled + AccessKeysAuthenticationEnabled AccessKeysAuthentication = "Enabled" ) // PossibleAccessKeysAuthenticationValues returns the possible values for the AccessKeysAuthentication const type. @@ -38,10 +41,11 @@ func PossibleAccessKeysAuthenticationValues() []AccessKeysAuthentication { } } -// ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. +// ActionType - Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. type ActionType string const ( + // ActionTypeInternal - Actions are for internal-only APIs. ActionTypeInternal ActionType = "Internal" ) @@ -57,8 +61,10 @@ func PossibleActionTypeValues() []ActionType { type AofFrequency string const ( + // AofFrequencyAlways - always AofFrequencyAlways AofFrequency = "always" - AofFrequencyOneS AofFrequency = "1s" + // AofFrequencyOneS - 1s + AofFrequencyOneS AofFrequency = "1s" ) // PossibleAofFrequencyValues returns the possible values for the AofFrequency const type. @@ -70,8 +76,7 @@ func PossibleAofFrequencyValues() []AofFrequency { } // ClusteringPolicy - Clustering policy - default is OSSCluster. This property can be updated only if the current value is -// NoCluster. If the value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting -// the database. +// NoCluster. If the value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting the database. type ClusteringPolicy string const ( @@ -99,8 +104,10 @@ func PossibleClusteringPolicyValues() []ClusteringPolicy { type CmkIdentityType string const ( + // CmkIdentityTypeSystemAssignedIdentity - systemAssignedIdentity CmkIdentityTypeSystemAssignedIdentity CmkIdentityType = "systemAssignedIdentity" - CmkIdentityTypeUserAssignedIdentity CmkIdentityType = "userAssignedIdentity" + // CmkIdentityTypeUserAssignedIdentity - userAssignedIdentity + CmkIdentityTypeUserAssignedIdentity CmkIdentityType = "userAssignedIdentity" ) // PossibleCmkIdentityTypeValues returns the possible values for the CmkIdentityType const type. @@ -111,14 +118,18 @@ func PossibleCmkIdentityTypeValues() []CmkIdentityType { } } -// CreatedByType - The type of identity that created the resource. +// CreatedByType - The kind of entity that created the resource. type CreatedByType string const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeApplication - The entity was created by an application. + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey - The entity was created by a key. + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity - The entity was created by a managed identity. CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" + // CreatedByTypeUser - The entity was created by a user. + CreatedByTypeUser CreatedByType = "User" ) // PossibleCreatedByTypeValues returns the possible values for the CreatedByType const type. @@ -135,7 +146,9 @@ func PossibleCreatedByTypeValues() []CreatedByType { type DeferUpgradeSetting string const ( - DeferUpgradeSettingDeferred DeferUpgradeSetting = "Deferred" + // DeferUpgradeSettingDeferred - Deferred + DeferUpgradeSettingDeferred DeferUpgradeSetting = "Deferred" + // DeferUpgradeSettingNotDeferred - NotDeferred DeferUpgradeSettingNotDeferred DeferUpgradeSetting = "NotDeferred" ) @@ -151,14 +164,22 @@ func PossibleDeferUpgradeSettingValues() []DeferUpgradeSetting { type EvictionPolicy string const ( - EvictionPolicyAllKeysLFU EvictionPolicy = "AllKeysLFU" - EvictionPolicyAllKeysLRU EvictionPolicy = "AllKeysLRU" - EvictionPolicyAllKeysRandom EvictionPolicy = "AllKeysRandom" - EvictionPolicyNoEviction EvictionPolicy = "NoEviction" - EvictionPolicyVolatileLFU EvictionPolicy = "VolatileLFU" - EvictionPolicyVolatileLRU EvictionPolicy = "VolatileLRU" + // EvictionPolicyAllKeysLFU - AllKeysLFU + EvictionPolicyAllKeysLFU EvictionPolicy = "AllKeysLFU" + // EvictionPolicyAllKeysLRU - AllKeysLRU + EvictionPolicyAllKeysLRU EvictionPolicy = "AllKeysLRU" + // EvictionPolicyAllKeysRandom - AllKeysRandom + EvictionPolicyAllKeysRandom EvictionPolicy = "AllKeysRandom" + // EvictionPolicyNoEviction - NoEviction + EvictionPolicyNoEviction EvictionPolicy = "NoEviction" + // EvictionPolicyVolatileLFU - VolatileLFU + EvictionPolicyVolatileLFU EvictionPolicy = "VolatileLFU" + // EvictionPolicyVolatileLRU - VolatileLRU + EvictionPolicyVolatileLRU EvictionPolicy = "VolatileLRU" + // EvictionPolicyVolatileRandom - VolatileRandom EvictionPolicyVolatileRandom EvictionPolicy = "VolatileRandom" - EvictionPolicyVolatileTTL EvictionPolicy = "VolatileTTL" + // EvictionPolicyVolatileTTL - VolatileTTL + EvictionPolicyVolatileTTL EvictionPolicy = "VolatileTTL" ) // PossibleEvictionPolicyValues returns the possible values for the EvictionPolicy const type. @@ -180,8 +201,10 @@ func PossibleEvictionPolicyValues() []EvictionPolicy { type HighAvailability string const ( + // HighAvailabilityDisabled - Disabled HighAvailabilityDisabled HighAvailability = "Disabled" - HighAvailabilityEnabled HighAvailability = "Enabled" + // HighAvailabilityEnabled - Enabled + HighAvailabilityEnabled HighAvailability = "Enabled" ) // PossibleHighAvailabilityValues returns the possible values for the HighAvailability const type. @@ -196,7 +219,9 @@ func PossibleHighAvailabilityValues() []HighAvailability { type Kind string const ( + // KindV1 - v1 KindV1 Kind = "v1" + // KindV2 - v2 KindV2 Kind = "v2" ) @@ -212,11 +237,16 @@ func PossibleKindValues() []Kind { type LinkState string const ( - LinkStateLinkFailed LinkState = "LinkFailed" - LinkStateLinked LinkState = "Linked" - LinkStateLinking LinkState = "Linking" + // LinkStateLinkFailed - LinkFailed + LinkStateLinkFailed LinkState = "LinkFailed" + // LinkStateLinked - Linked + LinkStateLinked LinkState = "Linked" + // LinkStateLinking - Linking + LinkStateLinking LinkState = "Linking" + // LinkStateUnlinkFailed - UnlinkFailed LinkStateUnlinkFailed LinkState = "UnlinkFailed" - LinkStateUnlinking LinkState = "Unlinking" + // LinkStateUnlinking - Unlinking + LinkStateUnlinking LinkState = "Unlinking" ) // PossibleLinkStateValues returns the possible values for the LinkState const type. @@ -230,14 +260,59 @@ func PossibleLinkStateValues() []LinkState { } } +// MaintenanceDayOfWeek - Day of week. Required when the maintenance window type is 'Weekly'. +type MaintenanceDayOfWeek string + +const ( + MaintenanceDayOfWeekFriday MaintenanceDayOfWeek = "Friday" + MaintenanceDayOfWeekMonday MaintenanceDayOfWeek = "Monday" + MaintenanceDayOfWeekSaturday MaintenanceDayOfWeek = "Saturday" + MaintenanceDayOfWeekSunday MaintenanceDayOfWeek = "Sunday" + MaintenanceDayOfWeekThursday MaintenanceDayOfWeek = "Thursday" + MaintenanceDayOfWeekTuesday MaintenanceDayOfWeek = "Tuesday" + MaintenanceDayOfWeekWednesday MaintenanceDayOfWeek = "Wednesday" +) + +// PossibleMaintenanceDayOfWeekValues returns the possible values for the MaintenanceDayOfWeek const type. +func PossibleMaintenanceDayOfWeekValues() []MaintenanceDayOfWeek { + return []MaintenanceDayOfWeek{ + MaintenanceDayOfWeekFriday, + MaintenanceDayOfWeekMonday, + MaintenanceDayOfWeekSaturday, + MaintenanceDayOfWeekSunday, + MaintenanceDayOfWeekThursday, + MaintenanceDayOfWeekTuesday, + MaintenanceDayOfWeekWednesday, + } +} + +// MaintenanceWindowType - Maintenance window type. +type MaintenanceWindowType string + +const ( + // MaintenanceWindowTypeWeekly - Weekly maintenance window. + MaintenanceWindowTypeWeekly MaintenanceWindowType = "Weekly" +) + +// PossibleMaintenanceWindowTypeValues returns the possible values for the MaintenanceWindowType const type. +func PossibleMaintenanceWindowTypeValues() []MaintenanceWindowType { + return []MaintenanceWindowType{ + MaintenanceWindowTypeWeekly, + } +} + // ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). type ManagedServiceIdentityType string const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" - ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" + // ManagedServiceIdentityTypeNone - No managed identity. + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + // ManagedServiceIdentityTypeSystemAssigned - System assigned managed identity. + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + // ManagedServiceIdentityTypeSystemAssignedUserAssigned - System and user assigned managed identity. + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned,UserAssigned" + // ManagedServiceIdentityTypeUserAssigned - User assigned managed identity. + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" ) // PossibleManagedServiceIdentityTypeValues returns the possible values for the ManagedServiceIdentityType const type. @@ -250,13 +325,50 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } +// MigrationProvisioningState - Current provisioning status +type MigrationProvisioningState string + +const ( + // MigrationProvisioningStateAccepted - The request has been accepted and the migration operation is being initialized. + MigrationProvisioningStateAccepted MigrationProvisioningState = "Accepted" + // MigrationProvisioningStateCancelled - The migration operation has been cancelled. + MigrationProvisioningStateCancelled MigrationProvisioningState = "Cancelled" + // MigrationProvisioningStateCancelling - The migration operation is being cancelled. + MigrationProvisioningStateCancelling MigrationProvisioningState = "Cancelling" + // MigrationProvisioningStateFailed - The migration operation has failed. + MigrationProvisioningStateFailed MigrationProvisioningState = "Failed" + // MigrationProvisioningStateInProgress - The migration operation is in progress. + MigrationProvisioningStateInProgress MigrationProvisioningState = "InProgress" + // MigrationProvisioningStateReadyForDNSSwitch - The migration operation has completed transferring data and is ready for + // DNS switch. + MigrationProvisioningStateReadyForDNSSwitch MigrationProvisioningState = "ReadyForDnsSwitch" + // MigrationProvisioningStateSucceeded - The migration operation has completed successfully. + MigrationProvisioningStateSucceeded MigrationProvisioningState = "Succeeded" +) + +// PossibleMigrationProvisioningStateValues returns the possible values for the MigrationProvisioningState const type. +func PossibleMigrationProvisioningStateValues() []MigrationProvisioningState { + return []MigrationProvisioningState{ + MigrationProvisioningStateAccepted, + MigrationProvisioningStateCancelled, + MigrationProvisioningStateCancelling, + MigrationProvisioningStateFailed, + MigrationProvisioningStateInProgress, + MigrationProvisioningStateReadyForDNSSwitch, + MigrationProvisioningStateSucceeded, + } +} + // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string const ( - OriginSystem Origin = "system" - OriginUser Origin = "user" + // OriginSystem - Indicates the operation is initiated by a system. + OriginSystem Origin = "system" + // OriginUser - Indicates the operation is initiated by a user. + OriginUser Origin = "user" + // OriginUserSystem - Indicates the operation is initiated by a user or system. OriginUserSystem Origin = "user,system" ) @@ -273,9 +385,13 @@ func PossibleOriginValues() []Origin { type PrivateEndpointConnectionProvisioningState string const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateCreating - Connection is being created + PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" + // PrivateEndpointConnectionProvisioningStateDeleting - Connection is being deleted + PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" + // PrivateEndpointConnectionProvisioningStateFailed - Connection provisioning has failed + PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" + // PrivateEndpointConnectionProvisioningStateSucceeded - Connection has been provisioned PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" ) @@ -293,8 +409,11 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin type PrivateEndpointServiceConnectionStatus string const ( + // PrivateEndpointServiceConnectionStatusApproved - Connection approved PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusPending - Connection waiting for approval or rejection + PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" + // PrivateEndpointServiceConnectionStatusRejected - Connection Rejected PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" ) @@ -311,7 +430,9 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer type Protocol string const ( + // ProtocolEncrypted - Encrypted ProtocolEncrypted Protocol = "Encrypted" + // ProtocolPlaintext - Plaintext ProtocolPlaintext Protocol = "Plaintext" ) @@ -327,12 +448,18 @@ func PossibleProtocolValues() []Protocol { type ProvisioningState string const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateCanceled - Canceled + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating - Creating + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting - Deleting + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed - Failed + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded - Succeeded ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" + // ProvisioningStateUpdating - Updating + ProvisioningStateUpdating ProvisioningState = "Updating" ) // PossibleProvisioningStateValues returns the possible values for the ProvisioningState const type. @@ -348,13 +475,15 @@ func PossibleProvisioningStateValues() []ProvisioningState { } // PublicNetworkAccess - Whether or not public network traffic can access the Redis cluster. Only 'Enabled' or 'Disabled' -// can be set. null is returned only for clusters created using an old API version which do not have this -// property and cannot be set. +// can be set. null is returned only for clusters created using an old API version which do not have this property and cannot +// be set. type PublicNetworkAccess string const ( + // PublicNetworkAccessDisabled - Disabled PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" - PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" + // PublicNetworkAccessEnabled - Enabled + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" ) // PossiblePublicNetworkAccessValues returns the possible values for the PublicNetworkAccess const type. @@ -369,8 +498,11 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { type RdbFrequency string const ( - RdbFrequencyOneH RdbFrequency = "1h" - RdbFrequencySixH RdbFrequency = "6h" + // RdbFrequencyOneH - 1h + RdbFrequencyOneH RdbFrequency = "1h" + // RdbFrequencySixH - 6h + RdbFrequencySixH RdbFrequency = "6h" + // RdbFrequencyTwelveH - 12h RdbFrequencyTwelveH RdbFrequency = "12h" ) @@ -408,21 +540,36 @@ func PossibleRedundancyModeValues() []RedundancyMode { type ResourceState string const ( - ResourceStateCreateFailed ResourceState = "CreateFailed" - ResourceStateCreating ResourceState = "Creating" - ResourceStateDeleteFailed ResourceState = "DeleteFailed" - ResourceStateDeleting ResourceState = "Deleting" + // ResourceStateCreateFailed - CreateFailed + ResourceStateCreateFailed ResourceState = "CreateFailed" + // ResourceStateCreating - Creating + ResourceStateCreating ResourceState = "Creating" + // ResourceStateDeleteFailed - DeleteFailed + ResourceStateDeleteFailed ResourceState = "DeleteFailed" + // ResourceStateDeleting - Deleting + ResourceStateDeleting ResourceState = "Deleting" + // ResourceStateDisableFailed - DisableFailed ResourceStateDisableFailed ResourceState = "DisableFailed" - ResourceStateDisabled ResourceState = "Disabled" - ResourceStateDisabling ResourceState = "Disabling" - ResourceStateEnableFailed ResourceState = "EnableFailed" - ResourceStateEnabling ResourceState = "Enabling" - ResourceStateMoving ResourceState = "Moving" - ResourceStateRunning ResourceState = "Running" - ResourceStateScaling ResourceState = "Scaling" + // ResourceStateDisabled - Disabled + ResourceStateDisabled ResourceState = "Disabled" + // ResourceStateDisabling - Disabling + ResourceStateDisabling ResourceState = "Disabling" + // ResourceStateEnableFailed - EnableFailed + ResourceStateEnableFailed ResourceState = "EnableFailed" + // ResourceStateEnabling - Enabling + ResourceStateEnabling ResourceState = "Enabling" + // ResourceStateMoving - Moving + ResourceStateMoving ResourceState = "Moving" + // ResourceStateRunning - Running + ResourceStateRunning ResourceState = "Running" + // ResourceStateScaling - Scaling + ResourceStateScaling ResourceState = "Scaling" + // ResourceStateScalingFailed - ScalingFailed ResourceStateScalingFailed ResourceState = "ScalingFailed" - ResourceStateUpdateFailed ResourceState = "UpdateFailed" - ResourceStateUpdating ResourceState = "Updating" + // ResourceStateUpdateFailed - UpdateFailed + ResourceStateUpdateFailed ResourceState = "UpdateFailed" + // ResourceStateUpdating - Updating + ResourceStateUpdating ResourceState = "Updating" ) // PossibleResourceStateValues returns the possible values for the ResourceState const type. @@ -446,67 +593,122 @@ func PossibleResourceStateValues() []ResourceState { } } -// SKUName - The level of Redis Enterprise cluster to deploy. Possible values: ('BalancedB5', 'MemoryOptimizedM10', 'ComputeOptimized_X5', -// etc.). For more information on SKUs see the latest pricing documentation. -// Note that additional SKUs may become supported in the future. +// SKUName - The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', +// etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported +// in the future. type SKUName string const ( - SKUNameBalancedB0 SKUName = "Balanced_B0" - SKUNameBalancedB1 SKUName = "Balanced_B1" - SKUNameBalancedB10 SKUName = "Balanced_B10" - SKUNameBalancedB100 SKUName = "Balanced_B100" - SKUNameBalancedB1000 SKUName = "Balanced_B1000" - SKUNameBalancedB150 SKUName = "Balanced_B150" - SKUNameBalancedB20 SKUName = "Balanced_B20" - SKUNameBalancedB250 SKUName = "Balanced_B250" - SKUNameBalancedB3 SKUName = "Balanced_B3" - SKUNameBalancedB350 SKUName = "Balanced_B350" - SKUNameBalancedB5 SKUName = "Balanced_B5" - SKUNameBalancedB50 SKUName = "Balanced_B50" - SKUNameBalancedB500 SKUName = "Balanced_B500" - SKUNameBalancedB700 SKUName = "Balanced_B700" - SKUNameComputeOptimizedX10 SKUName = "ComputeOptimized_X10" + // SKUNameBalancedB0 - Balanced_B0 + SKUNameBalancedB0 SKUName = "Balanced_B0" + // SKUNameBalancedB1 - Balanced_B1 + SKUNameBalancedB1 SKUName = "Balanced_B1" + // SKUNameBalancedB10 - Balanced_B10 + SKUNameBalancedB10 SKUName = "Balanced_B10" + // SKUNameBalancedB100 - Balanced_B100 + SKUNameBalancedB100 SKUName = "Balanced_B100" + // SKUNameBalancedB1000 - Balanced_B1000 + SKUNameBalancedB1000 SKUName = "Balanced_B1000" + // SKUNameBalancedB150 - Balanced_B150 + SKUNameBalancedB150 SKUName = "Balanced_B150" + // SKUNameBalancedB20 - Balanced_B20 + SKUNameBalancedB20 SKUName = "Balanced_B20" + // SKUNameBalancedB250 - Balanced_B250 + SKUNameBalancedB250 SKUName = "Balanced_B250" + // SKUNameBalancedB3 - Balanced_B3 + SKUNameBalancedB3 SKUName = "Balanced_B3" + // SKUNameBalancedB350 - Balanced_B350 + SKUNameBalancedB350 SKUName = "Balanced_B350" + // SKUNameBalancedB5 - Balanced_B5 + SKUNameBalancedB5 SKUName = "Balanced_B5" + // SKUNameBalancedB50 - Balanced_B50 + SKUNameBalancedB50 SKUName = "Balanced_B50" + // SKUNameBalancedB500 - Balanced_B500 + SKUNameBalancedB500 SKUName = "Balanced_B500" + // SKUNameBalancedB700 - Balanced_B700 + SKUNameBalancedB700 SKUName = "Balanced_B700" + // SKUNameComputeOptimizedX10 - ComputeOptimized_X10 + SKUNameComputeOptimizedX10 SKUName = "ComputeOptimized_X10" + // SKUNameComputeOptimizedX100 - ComputeOptimized_X100 SKUNameComputeOptimizedX100 SKUName = "ComputeOptimized_X100" + // SKUNameComputeOptimizedX150 - ComputeOptimized_X150 SKUNameComputeOptimizedX150 SKUName = "ComputeOptimized_X150" - SKUNameComputeOptimizedX20 SKUName = "ComputeOptimized_X20" + // SKUNameComputeOptimizedX20 - ComputeOptimized_X20 + SKUNameComputeOptimizedX20 SKUName = "ComputeOptimized_X20" + // SKUNameComputeOptimizedX250 - ComputeOptimized_X250 SKUNameComputeOptimizedX250 SKUName = "ComputeOptimized_X250" - SKUNameComputeOptimizedX3 SKUName = "ComputeOptimized_X3" + // SKUNameComputeOptimizedX3 - ComputeOptimized_X3 + SKUNameComputeOptimizedX3 SKUName = "ComputeOptimized_X3" + // SKUNameComputeOptimizedX350 - ComputeOptimized_X350 SKUNameComputeOptimizedX350 SKUName = "ComputeOptimized_X350" - SKUNameComputeOptimizedX5 SKUName = "ComputeOptimized_X5" - SKUNameComputeOptimizedX50 SKUName = "ComputeOptimized_X50" + // SKUNameComputeOptimizedX5 - ComputeOptimized_X5 + SKUNameComputeOptimizedX5 SKUName = "ComputeOptimized_X5" + // SKUNameComputeOptimizedX50 - ComputeOptimized_X50 + SKUNameComputeOptimizedX50 SKUName = "ComputeOptimized_X50" + // SKUNameComputeOptimizedX500 - ComputeOptimized_X500 SKUNameComputeOptimizedX500 SKUName = "ComputeOptimized_X500" + // SKUNameComputeOptimizedX700 - ComputeOptimized_X700 SKUNameComputeOptimizedX700 SKUName = "ComputeOptimized_X700" - SKUNameEnterpriseE1 SKUName = "Enterprise_E1" - SKUNameEnterpriseE10 SKUName = "Enterprise_E10" - SKUNameEnterpriseE100 SKUName = "Enterprise_E100" - SKUNameEnterpriseE20 SKUName = "Enterprise_E20" - SKUNameEnterpriseE200 SKUName = "Enterprise_E200" - SKUNameEnterpriseE400 SKUName = "Enterprise_E400" - SKUNameEnterpriseE5 SKUName = "Enterprise_E5" - SKUNameEnterpriseE50 SKUName = "Enterprise_E50" + // SKUNameEnterpriseE1 - Enterprise_E1 + SKUNameEnterpriseE1 SKUName = "Enterprise_E1" + // SKUNameEnterpriseE10 - Enterprise_E10 + SKUNameEnterpriseE10 SKUName = "Enterprise_E10" + // SKUNameEnterpriseE100 - Enterprise_E100 + SKUNameEnterpriseE100 SKUName = "Enterprise_E100" + // SKUNameEnterpriseE20 - Enterprise_E20 + SKUNameEnterpriseE20 SKUName = "Enterprise_E20" + // SKUNameEnterpriseE200 - Enterprise_E200 + SKUNameEnterpriseE200 SKUName = "Enterprise_E200" + // SKUNameEnterpriseE400 - Enterprise_E400 + SKUNameEnterpriseE400 SKUName = "Enterprise_E400" + // SKUNameEnterpriseE5 - Enterprise_E5 + SKUNameEnterpriseE5 SKUName = "Enterprise_E5" + // SKUNameEnterpriseE50 - Enterprise_E50 + SKUNameEnterpriseE50 SKUName = "Enterprise_E50" + // SKUNameEnterpriseFlashF1500 - EnterpriseFlash_F1500 SKUNameEnterpriseFlashF1500 SKUName = "EnterpriseFlash_F1500" - SKUNameEnterpriseFlashF300 SKUName = "EnterpriseFlash_F300" - SKUNameEnterpriseFlashF700 SKUName = "EnterpriseFlash_F700" - SKUNameFlashOptimizedA1000 SKUName = "FlashOptimized_A1000" - SKUNameFlashOptimizedA1500 SKUName = "FlashOptimized_A1500" - SKUNameFlashOptimizedA2000 SKUName = "FlashOptimized_A2000" - SKUNameFlashOptimizedA250 SKUName = "FlashOptimized_A250" - SKUNameFlashOptimizedA4500 SKUName = "FlashOptimized_A4500" - SKUNameFlashOptimizedA500 SKUName = "FlashOptimized_A500" - SKUNameFlashOptimizedA700 SKUName = "FlashOptimized_A700" - SKUNameMemoryOptimizedM10 SKUName = "MemoryOptimized_M10" - SKUNameMemoryOptimizedM100 SKUName = "MemoryOptimized_M100" + // SKUNameEnterpriseFlashF300 - EnterpriseFlash_F300 + SKUNameEnterpriseFlashF300 SKUName = "EnterpriseFlash_F300" + // SKUNameEnterpriseFlashF700 - EnterpriseFlash_F700 + SKUNameEnterpriseFlashF700 SKUName = "EnterpriseFlash_F700" + // SKUNameFlashOptimizedA1000 - FlashOptimized_A1000 + SKUNameFlashOptimizedA1000 SKUName = "FlashOptimized_A1000" + // SKUNameFlashOptimizedA1500 - FlashOptimized_A1500 + SKUNameFlashOptimizedA1500 SKUName = "FlashOptimized_A1500" + // SKUNameFlashOptimizedA2000 - FlashOptimized_A2000 + SKUNameFlashOptimizedA2000 SKUName = "FlashOptimized_A2000" + // SKUNameFlashOptimizedA250 - FlashOptimized_A250 + SKUNameFlashOptimizedA250 SKUName = "FlashOptimized_A250" + // SKUNameFlashOptimizedA4500 - FlashOptimized_A4500 + SKUNameFlashOptimizedA4500 SKUName = "FlashOptimized_A4500" + // SKUNameFlashOptimizedA500 - FlashOptimized_A500 + SKUNameFlashOptimizedA500 SKUName = "FlashOptimized_A500" + // SKUNameFlashOptimizedA700 - FlashOptimized_A700 + SKUNameFlashOptimizedA700 SKUName = "FlashOptimized_A700" + // SKUNameMemoryOptimizedM10 - MemoryOptimized_M10 + SKUNameMemoryOptimizedM10 SKUName = "MemoryOptimized_M10" + // SKUNameMemoryOptimizedM100 - MemoryOptimized_M100 + SKUNameMemoryOptimizedM100 SKUName = "MemoryOptimized_M100" + // SKUNameMemoryOptimizedM1000 - MemoryOptimized_M1000 SKUNameMemoryOptimizedM1000 SKUName = "MemoryOptimized_M1000" - SKUNameMemoryOptimizedM150 SKUName = "MemoryOptimized_M150" + // SKUNameMemoryOptimizedM150 - MemoryOptimized_M150 + SKUNameMemoryOptimizedM150 SKUName = "MemoryOptimized_M150" + // SKUNameMemoryOptimizedM1500 - MemoryOptimized_M1500 SKUNameMemoryOptimizedM1500 SKUName = "MemoryOptimized_M1500" - SKUNameMemoryOptimizedM20 SKUName = "MemoryOptimized_M20" + // SKUNameMemoryOptimizedM20 - MemoryOptimized_M20 + SKUNameMemoryOptimizedM20 SKUName = "MemoryOptimized_M20" + // SKUNameMemoryOptimizedM2000 - MemoryOptimized_M2000 SKUNameMemoryOptimizedM2000 SKUName = "MemoryOptimized_M2000" - SKUNameMemoryOptimizedM250 SKUName = "MemoryOptimized_M250" - SKUNameMemoryOptimizedM350 SKUName = "MemoryOptimized_M350" - SKUNameMemoryOptimizedM50 SKUName = "MemoryOptimized_M50" - SKUNameMemoryOptimizedM500 SKUName = "MemoryOptimized_M500" - SKUNameMemoryOptimizedM700 SKUName = "MemoryOptimized_M700" + // SKUNameMemoryOptimizedM250 - MemoryOptimized_M250 + SKUNameMemoryOptimizedM250 SKUName = "MemoryOptimized_M250" + // SKUNameMemoryOptimizedM350 - MemoryOptimized_M350 + SKUNameMemoryOptimizedM350 SKUName = "MemoryOptimized_M350" + // SKUNameMemoryOptimizedM50 - MemoryOptimized_M50 + SKUNameMemoryOptimizedM50 SKUName = "MemoryOptimized_M50" + // SKUNameMemoryOptimizedM500 - MemoryOptimized_M500 + SKUNameMemoryOptimizedM500 SKUName = "MemoryOptimized_M500" + // SKUNameMemoryOptimizedM700 - MemoryOptimized_M700 + SKUNameMemoryOptimizedM700 SKUName = "MemoryOptimized_M700" ) // PossibleSKUNameValues returns the possible values for the SKUName const type. @@ -570,14 +772,32 @@ func PossibleSKUNameValues() []SKUName { } } +// SourceType - Describes the source of the migration operation. +type SourceType string + +const ( + // SourceTypeAzureCacheForRedis - Migration from Azure Cache for Redis to Redis Enterprise. + SourceTypeAzureCacheForRedis SourceType = "AzureCacheForRedis" +) + +// PossibleSourceTypeValues returns the possible values for the SourceType const type. +func PossibleSourceTypeValues() []SourceType { + return []SourceType{ + SourceTypeAzureCacheForRedis, + } +} + // TLSVersion - The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. -// Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are -// mentioned only for the sake of consistency with old API versions. +// Note that TLS 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake +// of consistency with old API versions. type TLSVersion string const ( + // TLSVersionOne0 - 1.0 TLSVersionOne0 TLSVersion = "1.0" + // TLSVersionOne1 - 1.1 TLSVersionOne1 TLSVersion = "1.1" + // TLSVersionOne2 - 1.2 TLSVersionOne2 TLSVersion = "1.2" ) diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client.go index ca047b16ba66..cfd8568751ae 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -25,9 +24,9 @@ type DatabasesClient struct { } // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,7 +42,7 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreate - Creates a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -71,7 +70,7 @@ func (client *DatabasesClient) BeginCreate(ctx context.Context, resourceGroupNam // Create - Creates a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) create(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginCreate" @@ -96,6 +95,10 @@ func (client *DatabasesClient) create(ctx context.Context, resourceGroupName str // createCreateRequest creates the Create request. func (client *DatabasesClient) createCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters Database, _ *DatabasesClientBeginCreateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -108,18 +111,15 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -129,7 +129,7 @@ func (client *DatabasesClient) createCreateRequest(ctx context.Context, resource // BeginDelete - Deletes a single database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -156,7 +156,7 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a single database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginDelete" @@ -181,6 +181,10 @@ func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGrou // deleteCreateRequest creates the Delete request. func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, _ *DatabasesClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -193,25 +197,20 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // BeginExport - Exports a database file from target database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -239,7 +238,7 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam // Export - Exports a database file from target database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ExportClusterParameters, options *DatabasesClientBeginExportOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginExport" @@ -264,6 +263,10 @@ func (client *DatabasesClient) export(ctx context.Context, resourceGroupName str // exportCreateRequest creates the Export request. func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ExportClusterParameters, _ *DatabasesClientBeginExportOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/export" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -276,18 +279,14 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -297,7 +296,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource // BeginFlush - Flushes all the keys in this database and also from its linked databases. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -310,8 +309,7 @@ func (client *DatabasesClient) BeginFlush(ctx context.Context, resourceGroupName return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientFlushResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -324,7 +322,7 @@ func (client *DatabasesClient) BeginFlush(ctx context.Context, resourceGroupName // Flush - Flushes all the keys in this database and also from its linked databases. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) flush(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginFlushOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginFlush" @@ -349,6 +347,10 @@ func (client *DatabasesClient) flush(ctx context.Context, resourceGroupName stri // flushCreateRequest creates the Flush request. func (client *DatabasesClient) flushCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginFlushOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/flush" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -361,19 +363,15 @@ func (client *DatabasesClient) flushCreateRequest(ctx context.Context, resourceG return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { return nil, err } @@ -383,11 +381,11 @@ func (client *DatabasesClient) flushCreateRequest(ctx context.Context, resourceG } // BeginForceLinkToReplicationGroup - Forcibly recreates an existing database on the specified cluster, and rejoins it to -// an existing replication group. IMPORTANT NOTE: All data in this database will be discarded, and the database will -// temporarily be unavailable while rejoining the replication group. +// an existing replication group. **IMPORTANT NOTE:** All data in this database will be discarded, and the database will temporarily +// be unavailable while rejoining the replication group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -414,11 +412,11 @@ func (client *DatabasesClient) BeginForceLinkToReplicationGroup(ctx context.Cont } // ForceLinkToReplicationGroup - Forcibly recreates an existing database on the specified cluster, and rejoins it to an existing -// replication group. IMPORTANT NOTE: All data in this database will be discarded, and the database will -// temporarily be unavailable while rejoining the replication group. +// replication group. **IMPORTANT NOTE:** All data in this database will be discarded, and the database will temporarily be +// unavailable while rejoining the replication group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) forceLinkToReplicationGroup(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceLinkParameters, options *DatabasesClientBeginForceLinkToReplicationGroupOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginForceLinkToReplicationGroup" @@ -443,6 +441,10 @@ func (client *DatabasesClient) forceLinkToReplicationGroup(ctx context.Context, // forceLinkToReplicationGroupCreateRequest creates the ForceLinkToReplicationGroup request. func (client *DatabasesClient) forceLinkToReplicationGroupCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceLinkParameters, _ *DatabasesClientBeginForceLinkToReplicationGroupOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceLinkToReplicationGroup" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -455,18 +457,14 @@ func (client *DatabasesClient) forceLinkToReplicationGroupCreateRequest(ctx cont return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -476,7 +474,7 @@ func (client *DatabasesClient) forceLinkToReplicationGroupCreateRequest(ctx cont // BeginForceUnlink - Forcibly removes the link to the specified database resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -505,7 +503,7 @@ func (client *DatabasesClient) BeginForceUnlink(ctx context.Context, resourceGro // ForceUnlink - Forcibly removes the link to the specified database resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) forceUnlink(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceUnlinkParameters, options *DatabasesClientBeginForceUnlinkOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginForceUnlink" @@ -530,6 +528,10 @@ func (client *DatabasesClient) forceUnlink(ctx context.Context, resourceGroupNam // forceUnlinkCreateRequest creates the ForceUnlink request. func (client *DatabasesClient) forceUnlinkCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ForceUnlinkParameters, _ *DatabasesClientBeginForceUnlinkOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/forceUnlink" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -542,18 +544,14 @@ func (client *DatabasesClient) forceUnlinkCreateRequest(ctx context.Context, res return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -563,7 +561,7 @@ func (client *DatabasesClient) forceUnlinkCreateRequest(ctx context.Context, res // Get - Gets information about a database in a Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -594,6 +592,10 @@ func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string // getCreateRequest creates the Get request. func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, _ *DatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -606,16 +608,12 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -633,7 +631,7 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // BeginImport - Imports database files to target database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -661,7 +659,7 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam // Import - Imports database files to target database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ImportClusterParameters, options *DatabasesClientBeginImportOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginImport" @@ -686,6 +684,10 @@ func (client *DatabasesClient) importOperation(ctx context.Context, resourceGrou // importCreateRequest creates the Import request. func (client *DatabasesClient) importCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters ImportClusterParameters, _ *DatabasesClientBeginImportOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/import" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -698,18 +700,14 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -718,7 +716,7 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource // NewListByClusterPager - Gets all databases in the specified Redis Enterprise cluster. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -767,7 +765,7 @@ func (client *DatabasesClient) listByClusterCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -785,7 +783,7 @@ func (client *DatabasesClient) listByClusterHandleResponse(resp *http.Response) // ListKeys - Retrieves the access keys for the Redis Enterprise database. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -816,6 +814,10 @@ func (client *DatabasesClient) ListKeys(ctx context.Context, resourceGroupName s // listKeysCreateRequest creates the ListKeys request. func (client *DatabasesClient) listKeysCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, _ *DatabasesClientListKeysOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/listKeys" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -828,16 +830,12 @@ func (client *DatabasesClient) listKeysCreateRequest(ctx context.Context, resour return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -855,7 +853,7 @@ func (client *DatabasesClient) listKeysHandleResponse(resp *http.Response) (Data // BeginRegenerateKey - Regenerates the Redis Enterprise database's access keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -884,7 +882,7 @@ func (client *DatabasesClient) BeginRegenerateKey(ctx context.Context, resourceG // RegenerateKey - Regenerates the Redis Enterprise database's access keys. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) regenerateKey(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters RegenerateKeyParameters, options *DatabasesClientBeginRegenerateKeyOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginRegenerateKey" @@ -909,6 +907,10 @@ func (client *DatabasesClient) regenerateKey(ctx context.Context, resourceGroupN // regenerateKeyCreateRequest creates the RegenerateKey request. func (client *DatabasesClient) regenerateKeyCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters RegenerateKeyParameters, _ *DatabasesClientBeginRegenerateKeyOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/regenerateKey" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -921,18 +923,15 @@ func (client *DatabasesClient) regenerateKeyCreateRequest(ctx context.Context, r return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -942,7 +941,7 @@ func (client *DatabasesClient) regenerateKeyCreateRequest(ctx context.Context, r // BeginUpdate - Updates a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -970,7 +969,7 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates a database // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginUpdate" @@ -995,6 +994,10 @@ func (client *DatabasesClient) update(ctx context.Context, resourceGroupName str // updateCreateRequest creates the Update request. func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, parameters DatabaseUpdate, _ *DatabasesClientBeginUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1007,18 +1010,15 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { return nil, err } @@ -1028,7 +1028,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource // BeginUpgradeDBRedisVersion - Upgrades the database Redis version to the latest available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -1042,8 +1042,7 @@ func (client *DatabasesClient) BeginUpgradeDBRedisVersion(ctx context.Context, r return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[DatabasesClientUpgradeDBRedisVersionResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1056,7 +1055,7 @@ func (client *DatabasesClient) BeginUpgradeDBRedisVersion(ctx context.Context, r // UpgradeDBRedisVersion - Upgrades the database Redis version to the latest available. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *DatabasesClient) upgradeDBRedisVersion(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, options *DatabasesClientBeginUpgradeDBRedisVersionOptions) (*http.Response, error) { var err error const operationName = "DatabasesClient.BeginUpgradeDBRedisVersion" @@ -1081,6 +1080,10 @@ func (client *DatabasesClient) upgradeDBRedisVersion(ctx context.Context, resour // upgradeDBRedisVersionCreateRequest creates the UpgradeDBRedisVersion request. func (client *DatabasesClient) upgradeDBRedisVersionCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, databaseName string, _ *DatabasesClientBeginUpgradeDBRedisVersionOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/upgradeDBRedisVersion" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -1093,17 +1096,12 @@ func (client *DatabasesClient) upgradeDBRedisVersionCreateRequest(ctx context.Co return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client_example_test.go index 107a6054c053..01c09957f84b 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/databases_client_example_test.go @@ -1,82 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesListByCluster.json -func ExampleDatabasesClient_NewListByClusterPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDatabasesClient().NewListByClusterPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.DatabaseList = armredisenterprise.DatabaseList{ - // Value: []*armredisenterprise.Database{ - // { - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationDisabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), - // Modules: []*armredisenterprise.Module{ - // { - // Name: to.Ptr("RediSearch"), - // Args: to.Ptr(""), - // Version: to.Ptr("1.0.0"), - // }}, - // Persistence: &armredisenterprise.Persistence{ - // RdbEnabled: to.Ptr(true), - // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), - // }, - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6.0"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesCreate.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesCreate.json func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -98,7 +41,8 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() { }, { Name: to.Ptr("RediSearch"), - }}, + }, + }, Persistence: &armredisenterprise.Persistence{ AofEnabled: to.Ptr(true), AofFrequency: to.Ptr(armredisenterprise.AofFrequencyOneS), @@ -116,61 +60,76 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), - // Modules: []*armredisenterprise.Module{ - // { - // Name: to.Ptr("RedisBloom"), - // Args: to.Ptr("ERROR_RATE 0.00 INITIAL_SIZE 400"), - // Version: to.Ptr("1.0.0"), + // res = armredisenterprise.DatabasesClientCreateResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), + // Modules: []*armredisenterprise.Module{ + // { + // Name: to.Ptr("RedisBloom"), + // Args: to.Ptr("ERROR_RATE 0.00 INITIAL_SIZE 400"), + // Version: to.Ptr("1.0.0"), + // }, + // { + // Name: to.Ptr("RedisTimeSeries"), + // Args: to.Ptr("RETENTION_POLICY 20"), + // Version: to.Ptr("1.0.0"), + // }, + // { + // Name: to.Ptr("RediSearch"), + // Args: to.Ptr(""), + // Version: to.Ptr("1.0.0"), + // }, // }, - // { - // Name: to.Ptr("RedisTimeSeries"), - // Args: to.Ptr("RETENTION_POLICY 20"), - // Version: to.Ptr("1.0.0"), + // Persistence: &armredisenterprise.Persistence{ + // AofEnabled: to.Ptr(true), + // AofFrequency: to.Ptr(armredisenterprise.AofFrequencyOneS), // }, - // { - // Name: to.Ptr("RediSearch"), - // Args: to.Ptr(""), - // Version: to.Ptr("1.0.0"), - // }}, - // Persistence: &armredisenterprise.Persistence{ - // AofEnabled: to.Ptr(true), - // AofFrequency: to.Ptr(armredisenterprise.AofFrequencyOneS), + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // RedisVersion: to.Ptr("6.0"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), // }, - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6.0"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesNoClusterCacheCreate.json -func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateNoClusterCache() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesCreateWithGeoReplication.json +func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActiveGeoReplication() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "rg1", "cache1", "default", armredisenterprise.Database{ Properties: &armredisenterprise.DatabaseCreateProperties{ - ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyNoCluster), - EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - Port: to.Ptr[int32](10000), + AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), + EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + GeoReplication: &armredisenterprise.DatabasePropertiesGeoReplication{ + GroupNickname: to.Ptr("groupName"), + LinkedDatabases: []*armredisenterprise.LinkedDatabase{ + { + ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + }, + { + ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), + }, + }, + }, + Port: to.Ptr[int32](10000), }, }, nil) if err != nil { @@ -183,52 +142,56 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateNoClusterC // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyNoCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("7.2"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), + // res = armredisenterprise.DatabasesClientCreateResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + // GeoReplication: &armredisenterprise.DatabasePropertiesGeoReplication{ + // GroupNickname: to.Ptr("groupName"), + // LinkedDatabases: []*armredisenterprise.LinkedDatabase{ + // { + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // State: to.Ptr(armredisenterprise.LinkStateLinking), + // }, + // { + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), + // State: to.Ptr(armredisenterprise.LinkStateLinking), + // }, + // }, + // }, + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // RedisVersion: to.Ptr("6.0"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), + // }, // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesCreateWithGeoReplication.json -func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActiveGeoReplication() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesNoClusterCacheCreate.json +func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateNoClusterCache() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDatabasesClient().BeginCreate(ctx, "rg1", "cache1", "default", armredisenterprise.Database{ Properties: &armredisenterprise.DatabaseCreateProperties{ - AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), - EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - GeoReplication: &armredisenterprise.DatabaseCommonPropertiesGeoReplication{ - GroupNickname: to.Ptr("groupName"), - LinkedDatabases: []*armredisenterprise.LinkedDatabase{ - { - ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - }, - { - ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), - }}, - }, - Port: to.Ptr[int32](10000), + ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyNoCluster), + EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + Port: to.Ptr[int32](10000), }, }, nil) if err != nil { @@ -241,58 +204,38 @@ func ExampleDatabasesClient_BeginCreate_redisEnterpriseDatabasesCreateWithActive // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - // GeoReplication: &armredisenterprise.DatabaseCommonPropertiesGeoReplication{ - // GroupNickname: to.Ptr("groupName"), - // LinkedDatabases: []*armredisenterprise.LinkedDatabase{ - // { - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8e/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // State: to.Ptr(armredisenterprise.LinkStateLinking), - // }, - // { - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), - // State: to.Ptr(armredisenterprise.LinkStateLinking), - // }}, + // res = armredisenterprise.DatabasesClientCreateResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyNoCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // RedisVersion: to.Ptr("7.2"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), // }, - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6.0"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesUpdate.json -func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdate() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesDelete.json +func ExampleDatabasesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "rg1", "cache1", "default", armredisenterprise.DatabaseUpdate{ - Properties: &armredisenterprise.DatabaseUpdateProperties{ - AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), - Persistence: &armredisenterprise.Persistence{ - RdbEnabled: to.Ptr(true), - RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), - }, - }, - }, nil) + poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "rg1", "cache1", "db1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -303,52 +246,23 @@ func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdate() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), - // Modules: []*armredisenterprise.Module{ - // { - // Name: to.Ptr("RediSearch"), - // Args: to.Ptr(""), - // Version: to.Ptr("1.0.0"), - // }}, - // Persistence: &armredisenterprise.Persistence{ - // RdbEnabled: to.Ptr(true), - // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), - // }, - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6.0"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), - // }, + // res = armredisenterprise.DatabasesClientDeleteResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json -func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdateClusteringOnNoClusterCache() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesExport.json +func ExampleDatabasesClient_BeginExport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "rg1", "cache1", "default", armredisenterprise.DatabaseUpdate{ - Properties: &armredisenterprise.DatabaseUpdateProperties{ - ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), - EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - Port: to.Ptr[int32](10000), - }, + poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "rg1", "cache1", "default", armredisenterprise.ExportClusterParameters{ + SasURI: to.Ptr("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) @@ -360,82 +274,65 @@ func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdateClustering // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("7.2"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), - // }, + // res = armredisenterprise.DatabasesClientExportResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesGet.json -func ExampleDatabasesClient_Get() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesFlush.json +func ExampleDatabasesClient_BeginFlush() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewDatabasesClient().Get(ctx, "rg1", "cache1", "default", nil) + poller, err := clientFactory.NewDatabasesClient().BeginFlush(ctx, "rg1", "cache1", "default", &armredisenterprise.DatabasesClientBeginFlushOptions{ + Parameters: &armredisenterprise.FlushParameters{ + IDs: []*string{ + to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), + }, + }}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.Database = armredisenterprise.Database{ - // Name: to.Ptr("cache1/default"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - // Properties: &armredisenterprise.DatabaseCreateProperties{ - // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), - // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), - // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), - // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), - // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), - // Modules: []*armredisenterprise.Module{ - // { - // Name: to.Ptr("RediSearch"), - // Args: to.Ptr(""), - // Version: to.Ptr("1.0.0"), - // }}, - // Persistence: &armredisenterprise.Persistence{ - // RdbEnabled: to.Ptr(true), - // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), - // }, - // Port: to.Ptr[int32](10000), - // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), - // RedisVersion: to.Ptr("6.0"), - // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), - // }, + // res = armredisenterprise.DatabasesClientFlushResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesDelete.json -func ExampleDatabasesClient_BeginDelete() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesForceLink.json +func ExampleDatabasesClient_BeginForceLinkToReplicationGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginDelete(ctx, "rg1", "cache1", "db1", nil) + poller, err := clientFactory.NewDatabasesClient().BeginForceLinkToReplicationGroup(ctx, "rg1", "cache1", "default", armredisenterprise.ForceLinkParameters{ + GeoReplication: &armredisenterprise.ForceLinkParametersGeoReplication{ + GroupNickname: to.Ptr("groupName"), + LinkedDatabases: []*armredisenterprise.LinkedDatabase{ + { + ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + }, + { + ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), + }, + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } @@ -445,197 +342,352 @@ func ExampleDatabasesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesListKeys.json -func ExampleDatabasesClient_ListKeys() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesForceUnlink.json +func ExampleDatabasesClient_BeginForceUnlink() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := clientFactory.NewDatabasesClient().ListKeys(ctx, "rg1", "cache1", "default", nil) + poller, err := clientFactory.NewDatabasesClient().BeginForceUnlink(ctx, "rg1", "cache1", "default", armredisenterprise.ForceUnlinkParameters{ + IDs: []*string{ + to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armredisenterprise.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), + // res = armredisenterprise.DatabasesClientForceUnlinkResponse{ // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesRegenerateKey.json -func ExampleDatabasesClient_BeginRegenerateKey() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesGet.json +func ExampleDatabasesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginRegenerateKey(ctx, "rg1", "cache1", "default", armredisenterprise.RegenerateKeyParameters{ - KeyType: to.Ptr(armredisenterprise.AccessKeyTypePrimary), - }, nil) + res, err := clientFactory.NewDatabasesClient().Get(ctx, "rg1", "cache1", "default", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AccessKeys = armredisenterprise.AccessKeys{ - // PrimaryKey: to.Ptr(""), - // SecondaryKey: to.Ptr(""), + // res = armredisenterprise.DatabasesClientGetResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), + // Modules: []*armredisenterprise.Module{ + // { + // Name: to.Ptr("RediSearch"), + // Args: to.Ptr(""), + // Version: to.Ptr("1.0.0"), + // }, + // }, + // Persistence: &armredisenterprise.Persistence{ + // RdbEnabled: to.Ptr(true), + // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), + // }, + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // RedisVersion: to.Ptr("6.0"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesImport.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesImport.json func ExampleDatabasesClient_BeginImport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } poller, err := clientFactory.NewDatabasesClient().BeginImport(ctx, "rg1", "cache1", "default", armredisenterprise.ImportClusterParameters{ SasUris: []*string{ to.Ptr("https://contosostorage.blob.core.window.net/urltoBlobFile1?sasKeyParameters"), - to.Ptr("https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters")}, + to.Ptr("https://contosostorage.blob.core.window.net/urltoBlobFile2?sasKeyParameters"), + }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.DatabasesClientImportResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesExport.json -func ExampleDatabasesClient_BeginExport() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesListByCluster.json +func ExampleDatabasesClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginExport(ctx, "rg1", "cache1", "default", armredisenterprise.ExportClusterParameters{ - SasURI: to.Ptr("https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters"), - }, nil) + pager := clientFactory.NewDatabasesClient().NewListByClusterPager("rg1", "cache1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armredisenterprise.DatabasesClientListByClusterResponse{ + // DatabaseList: armredisenterprise.DatabaseList{ + // Value: []*armredisenterprise.Database{ + // { + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationDisabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), + // Modules: []*armredisenterprise.Module{ + // { + // Name: to.Ptr("RediSearch"), + // Args: to.Ptr(""), + // Version: to.Ptr("1.0.0"), + // }, + // }, + // Persistence: &armredisenterprise.Persistence{ + // RdbEnabled: to.Ptr(true), + // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), + // }, + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateSucceeded), + // RedisVersion: to.Ptr("6.0"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateRunning), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesListKeys.json +func ExampleDatabasesClient_ListKeys() { + cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { - log.Fatalf("failed to finish the request: %v", err) + log.Fatalf("failed to obtain a credential: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { - log.Fatalf("failed to pull the result: %v", err) + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewDatabasesClient().ListKeys(ctx, "rg1", "cache1", "default", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.DatabasesClientListKeysResponse{ + // AccessKeys: &armredisenterprise.AccessKeys{ + // PrimaryKey: to.Ptr(""), + // SecondaryKey: to.Ptr(""), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesForceUnlink.json -func ExampleDatabasesClient_BeginForceUnlink() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesRegenerateKey.json +func ExampleDatabasesClient_BeginRegenerateKey() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginForceUnlink(ctx, "rg1", "cache1", "default", armredisenterprise.ForceUnlinkParameters{ - IDs: []*string{ - to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")}, + poller, err := clientFactory.NewDatabasesClient().BeginRegenerateKey(ctx, "rg1", "cache1", "default", armredisenterprise.RegenerateKeyParameters{ + KeyType: to.Ptr(armredisenterprise.AccessKeyTypePrimary), }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.DatabasesClientRegenerateKeyResponse{ + // AccessKeys: &armredisenterprise.AccessKeys{ + // PrimaryKey: to.Ptr(""), + // SecondaryKey: to.Ptr(""), + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesForceLink.json -func ExampleDatabasesClient_BeginForceLinkToReplicationGroup() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesNoClusterCacheUpdateClustering.json +func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdateClusteringOnNoClusterCache() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginForceLinkToReplicationGroup(ctx, "rg1", "cache1", "default", armredisenterprise.ForceLinkParameters{ - GeoReplication: &armredisenterprise.ForceLinkParametersGeoReplication{ - GroupNickname: to.Ptr("groupName"), - LinkedDatabases: []*armredisenterprise.LinkedDatabase{ - { - ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), - }, - { - ID: to.Ptr("/subscriptions/11111111-1111-1111-1111-111111111111/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default"), - }}, + poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "rg1", "cache1", "default", armredisenterprise.DatabaseUpdate{ + Properties: &armredisenterprise.DatabaseUpdateProperties{ + ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), + EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + Port: to.Ptr[int32](10000), }, }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.DatabasesClientUpdateResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyEnterpriseCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyNoEviction), + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // RedisVersion: to.Ptr("7.2"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesFlush.json -func ExampleDatabasesClient_BeginFlush() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesUpdate.json +func ExampleDatabasesClient_BeginUpdate_redisEnterpriseDatabasesUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewDatabasesClient().BeginFlush(ctx, "rg1", "cache1", "default", &armredisenterprise.DatabasesClientBeginFlushOptions{Parameters: &armredisenterprise.FlushParameters{ - IDs: []*string{ - to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f2/resourceGroups/rg2/providers/Microsoft.Cache/redisEnterprise/cache2/databases/default")}, - }, - }) + poller, err := clientFactory.NewDatabasesClient().BeginUpdate(ctx, "rg1", "cache1", "default", armredisenterprise.DatabaseUpdate{ + Properties: &armredisenterprise.DatabaseUpdateProperties{ + AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), + Persistence: &armredisenterprise.Persistence{ + RdbEnabled: to.Ptr(true), + RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - _, err = poller.PollUntilDone(ctx, nil) + res, err := poller.PollUntilDone(ctx, nil) if err != nil { log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.DatabasesClientUpdateResponse{ + // Database: &armredisenterprise.Database{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/databases"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/databases/default"), + // Properties: &armredisenterprise.DatabaseCreateProperties{ + // AccessKeysAuthentication: to.Ptr(armredisenterprise.AccessKeysAuthenticationEnabled), + // ClientProtocol: to.Ptr(armredisenterprise.ProtocolEncrypted), + // ClusteringPolicy: to.Ptr(armredisenterprise.ClusteringPolicyOSSCluster), + // DeferUpgrade: to.Ptr(armredisenterprise.DeferUpgradeSettingNotDeferred), + // EvictionPolicy: to.Ptr(armredisenterprise.EvictionPolicyAllKeysLRU), + // Modules: []*armredisenterprise.Module{ + // { + // Name: to.Ptr("RediSearch"), + // Args: to.Ptr(""), + // Version: to.Ptr("1.0.0"), + // }, + // }, + // Persistence: &armredisenterprise.Persistence{ + // RdbEnabled: to.Ptr(true), + // RdbFrequency: to.Ptr(armredisenterprise.RdbFrequencyTwelveH), + // }, + // Port: to.Ptr[int32](10000), + // ProvisioningState: to.Ptr(armredisenterprise.ProvisioningStateUpdating), + // RedisVersion: to.Ptr("6.0"), + // ResourceState: to.Ptr(armredisenterprise.ResourceStateUpdating), + // }, + // }, + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDatabasesUpgradeDBRedisVersion.json func ExampleDatabasesClient_BeginUpgradeDBRedisVersion() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/accesspolicyassignment_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/accesspolicyassignment_server.go index 0ca6805b1c6b..23a979e5f1b5 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/accesspolicyassignment_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/accesspolicyassignment_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/databases_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/databases_server.go index 0432789a898d..efdaa766afff 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/databases_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/databases_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "reflect" diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/internal.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/internal.go index 4b65adc76adb..d9ae2e5818f8 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/internal.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/internal.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -33,6 +32,14 @@ func contains[T comparable](s []T, v T) bool { return false } +func initServer[T any](mu *sync.Mutex, dst **T, src func() *T) { + mu.Lock() + if *dst == nil { + *dst = src() + } + mu.Unlock() +} + func newTracker[T any]() *tracker[T] { return &tracker[T]{ items: map[string]*T{}, diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/migration_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/migration_server.go new file mode 100644 index 000000000000..3df25597fd13 --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/migration_server.go @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "net/http" + "net/url" + "regexp" +) + +// MigrationServer is a fake server for instances of the armredisenterprise.MigrationClient type. +type MigrationServer struct { + // BeginCancel is the fake for method MigrationClient.BeginCancel + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted, http.StatusNoContent + BeginCancel func(ctx context.Context, resourceGroupName string, clusterName string, options *armredisenterprise.MigrationClientBeginCancelOptions) (resp azfake.PollerResponder[armredisenterprise.MigrationClientCancelResponse], errResp azfake.ErrorResponder) + + // Get is the fake for method MigrationClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, clusterName string, options *armredisenterprise.MigrationClientGetOptions) (resp azfake.Responder[armredisenterprise.MigrationClientGetResponse], errResp azfake.ErrorResponder) + + // NewListPager is the fake for method MigrationClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, clusterName string, options *armredisenterprise.MigrationClientListOptions) (resp azfake.PagerResponder[armredisenterprise.MigrationClientListResponse]) + + // BeginStart is the fake for method MigrationClient.BeginStart + // HTTP status codes to indicate success: http.StatusOK, http.StatusCreated + BeginStart func(ctx context.Context, resourceGroupName string, clusterName string, parameters armredisenterprise.Migration, options *armredisenterprise.MigrationClientBeginStartOptions) (resp azfake.PollerResponder[armredisenterprise.MigrationClientStartResponse], errResp azfake.ErrorResponder) +} + +// NewMigrationServerTransport creates a new instance of MigrationServerTransport with the provided implementation. +// The returned MigrationServerTransport instance is connected to an instance of armredisenterprise.MigrationClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewMigrationServerTransport(srv *MigrationServer) *MigrationServerTransport { + return &MigrationServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armredisenterprise.MigrationClientCancelResponse]](), + newListPager: newTracker[azfake.PagerResponder[armredisenterprise.MigrationClientListResponse]](), + beginStart: newTracker[azfake.PollerResponder[armredisenterprise.MigrationClientStartResponse]](), + } +} + +// MigrationServerTransport connects instances of armredisenterprise.MigrationClient to instances of MigrationServer. +// Don't use this type directly, use NewMigrationServerTransport instead. +type MigrationServerTransport struct { + srv *MigrationServer + beginCancel *tracker[azfake.PollerResponder[armredisenterprise.MigrationClientCancelResponse]] + newListPager *tracker[azfake.PagerResponder[armredisenterprise.MigrationClientListResponse]] + beginStart *tracker[azfake.PollerResponder[armredisenterprise.MigrationClientStartResponse]] +} + +// Do implements the policy.Transporter interface for MigrationServerTransport. +func (m *MigrationServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + return m.dispatchToMethodFake(req, method) +} + +func (m *MigrationServerTransport) dispatchToMethodFake(req *http.Request, method string) (*http.Response, error) { + resultChan := make(chan result) + defer close(resultChan) + + go func() { + var intercepted bool + var res result + if migrationServerTransportInterceptor != nil { + res.resp, res.err, intercepted = migrationServerTransportInterceptor.Do(req) + } + if !intercepted { + switch method { + case "MigrationClient.BeginCancel": + res.resp, res.err = m.dispatchBeginCancel(req) + case "MigrationClient.Get": + res.resp, res.err = m.dispatchGet(req) + case "MigrationClient.NewListPager": + res.resp, res.err = m.dispatchNewListPager(req) + case "MigrationClient.BeginStart": + res.resp, res.err = m.dispatchBeginStart(req) + default: + res.err = fmt.Errorf("unhandled API %s", method) + } + + } + select { + case resultChan <- res: + case <-req.Context().Done(): + } + }() + + select { + case <-req.Context().Done(): + return nil, req.Context().Err() + case res := <-resultChan: + return res.resp, res.err + } +} + +func (m *MigrationServerTransport) dispatchBeginCancel(req *http.Request) (*http.Response, error) { + if m.srv.BeginCancel == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} + } + beginCancel := m.beginCancel.get(req) + if beginCancel == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/default/cancel` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginCancel(req.Context(), resourceGroupNameParam, clusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginCancel = &respr + m.beginCancel.add(req, beginCancel) + } + + resp, err := server.PollerResponderNext(beginCancel, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + m.beginCancel.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} + } + if !server.PollerResponderMore(beginCancel) { + m.beginCancel.remove(req) + } + + return resp, nil +} + +func (m *MigrationServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if m.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.Get(req.Context(), resourceGroupNameParam, clusterNameParam, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).Migration, req) + if err != nil { + return nil, err + } + return resp, nil +} + +func (m *MigrationServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if m.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := m.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + resp := m.srv.NewListPager(resourceGroupNameParam, clusterNameParam, nil) + newListPager = &resp + m.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armredisenterprise.MigrationClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + m.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + m.newListPager.remove(req) + } + return resp, nil +} + +func (m *MigrationServerTransport) dispatchBeginStart(req *http.Request) (*http.Response, error) { + if m.srv.BeginStart == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} + } + beginStart := m.beginStart.get(req) + if beginStart == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.Cache/redisEnterprise/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/migrations/default` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if len(matches) < 4 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armredisenterprise.Migration](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + clusterNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("clusterName")]) + if err != nil { + return nil, err + } + respr, errRespr := m.srv.BeginStart(req.Context(), resourceGroupNameParam, clusterNameParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginStart = &respr + m.beginStart.add(req, beginStart) + } + + resp, err := server.PollerResponderNext(beginStart, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + m.beginStart.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} + } + if !server.PollerResponderMore(beginStart) { + m.beginStart.remove(req) + } + + return resp, nil +} + +// set this to conditionally intercept incoming requests to MigrationServerTransport +var migrationServerTransportInterceptor interface { + // Do returns true if the server transport should use the returned response/error + Do(*http.Request) (*http.Response, error, bool) +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operations_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operations_server.go index e044ad6fdabd..32d2a262c2f2 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operations_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operations_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" ) diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operationsstatus_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operationsstatus_server.go index ddf6eec4eee3..9990ad17d089 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operationsstatus_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/operationsstatus_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privateendpointconnections_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privateendpointconnections_server.go index 468be575654e..8959ca74a705 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privateendpointconnections_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privateendpointconnections_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -12,7 +11,8 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "regexp" @@ -216,6 +216,9 @@ func (p *PrivateEndpointConnectionsServerTransport) dispatchNewListPager(req *ht resp := p.srv.NewListPager(resourceGroupNameParam, clusterNameParam, nil) newListPager = &resp p.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armredisenterprise.PrivateEndpointConnectionsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListPager, req) if err != nil { diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privatelinkresources_server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privatelinkresources_server.go index d4b80d00fb6d..0a7f12b0b3f1 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privatelinkresources_server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/privatelinkresources_server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -11,7 +10,8 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "regexp" @@ -108,6 +108,9 @@ func (p *PrivateLinkResourcesServerTransport) dispatchNewListByClusterPager(req resp := p.srv.NewListByClusterPager(resourceGroupNameParam, clusterNameParam, nil) newListByClusterPager = &resp p.newListByClusterPager.add(req, newListByClusterPager) + server.PagerResponderInjectNextLinks(newListByClusterPager, req, func(page *armredisenterprise.PrivateLinkResourcesClientListByClusterResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) } resp, err := server.PagerResponderNext(newListByClusterPager, req) if err != nil { diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server.go index 102215969a3e..3699e55d8afb 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -13,7 +12,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server_factory.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server_factory.go index 734396256876..9a83e01fde75 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server_factory.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/fake/server_factory.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package fake @@ -25,6 +24,9 @@ type ServerFactory struct { // DatabasesServer contains the fakes for client DatabasesClient DatabasesServer DatabasesServer + // MigrationServer contains the fakes for client MigrationClient + MigrationServer MigrationServer + // OperationsServer contains the fakes for client OperationsClient OperationsServer OperationsServer @@ -55,6 +57,7 @@ type ServerFactoryTransport struct { trAccessPolicyAssignmentServer *AccessPolicyAssignmentServerTransport trServer *ServerTransport trDatabasesServer *DatabasesServerTransport + trMigrationServer *MigrationServerTransport trOperationsServer *OperationsServerTransport trOperationsStatusServer *OperationsStatusServerTransport trPrivateEndpointConnectionsServer *PrivateEndpointConnectionsServerTransport @@ -75,31 +78,34 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { switch client { case "AccessPolicyAssignmentClient": - initServer(s, &s.trAccessPolicyAssignmentServer, func() *AccessPolicyAssignmentServerTransport { + initServer(&s.trMu, &s.trAccessPolicyAssignmentServer, func() *AccessPolicyAssignmentServerTransport { return NewAccessPolicyAssignmentServerTransport(&s.srv.AccessPolicyAssignmentServer) }) resp, err = s.trAccessPolicyAssignmentServer.Do(req) case "Client": - initServer(s, &s.trServer, func() *ServerTransport { return NewServerTransport(&s.srv.Server) }) + initServer(&s.trMu, &s.trServer, func() *ServerTransport { return NewServerTransport(&s.srv.Server) }) resp, err = s.trServer.Do(req) case "DatabasesClient": - initServer(s, &s.trDatabasesServer, func() *DatabasesServerTransport { return NewDatabasesServerTransport(&s.srv.DatabasesServer) }) + initServer(&s.trMu, &s.trDatabasesServer, func() *DatabasesServerTransport { return NewDatabasesServerTransport(&s.srv.DatabasesServer) }) resp, err = s.trDatabasesServer.Do(req) + case "MigrationClient": + initServer(&s.trMu, &s.trMigrationServer, func() *MigrationServerTransport { return NewMigrationServerTransport(&s.srv.MigrationServer) }) + resp, err = s.trMigrationServer.Do(req) case "OperationsClient": - initServer(s, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) + initServer(&s.trMu, &s.trOperationsServer, func() *OperationsServerTransport { return NewOperationsServerTransport(&s.srv.OperationsServer) }) resp, err = s.trOperationsServer.Do(req) case "OperationsStatusClient": - initServer(s, &s.trOperationsStatusServer, func() *OperationsStatusServerTransport { + initServer(&s.trMu, &s.trOperationsStatusServer, func() *OperationsStatusServerTransport { return NewOperationsStatusServerTransport(&s.srv.OperationsStatusServer) }) resp, err = s.trOperationsStatusServer.Do(req) case "PrivateEndpointConnectionsClient": - initServer(s, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { + initServer(&s.trMu, &s.trPrivateEndpointConnectionsServer, func() *PrivateEndpointConnectionsServerTransport { return NewPrivateEndpointConnectionsServerTransport(&s.srv.PrivateEndpointConnectionsServer) }) resp, err = s.trPrivateEndpointConnectionsServer.Do(req) case "PrivateLinkResourcesClient": - initServer(s, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { + initServer(&s.trMu, &s.trPrivateLinkResourcesServer, func() *PrivateLinkResourcesServerTransport { return NewPrivateLinkResourcesServerTransport(&s.srv.PrivateLinkResourcesServer) }) resp, err = s.trPrivateLinkResourcesServer.Do(req) @@ -113,11 +119,3 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return resp, nil } - -func initServer[T any](s *ServerFactoryTransport, dst **T, src func() *T) { - s.trMu.Lock() - if *dst == nil { - *dst = src() - } - s.trMu.Unlock() -} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/go.mod b/sdk/resourcemanager/redisenterprise/armredisenterprise/go.mod index 5b1a8b17c859..c44c3bc291c7 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/go.mod +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/go.mod @@ -1,9 +1,9 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4 go 1.24.0 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 github.com/Azure/azure-sdk-for-go/sdk/internal v1.11.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3 v3.1.0 @@ -19,9 +19,9 @@ require ( github.com/kylelemons/godebug v1.1.0 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.45.0 // indirect - golang.org/x/net v0.47.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/crypto v0.47.0 // indirect + golang.org/x/net v0.49.0 // indirect + golang.org/x/sys v0.40.0 // indirect + golang.org/x/text v0.33.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/go.sum b/sdk/resourcemanager/redisenterprise/armredisenterprise/go.sum index cc236fb92e86..f4450ac568ee 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/go.sum +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0 h1:JXg2dwJUmPB9JmtVmdEB16APJ7jurfbY5jnfXpJoRMc= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.20.0/go.mod h1:YD5h/ldMsG0XiIw7PdyNhLxaM317eFh5yNLccNfGdyw= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0 h1:fou+2+WFTib47nS+nz/ozhEBnvU96bKHy6LjRsY4E28= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.21.0/go.mod h1:t76Ruy8AHvUAC8GfMWJMa0ElSbuIcO03NLpynfbgsPA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1 h1:Hk5QBxZQC1jb2Fwj6mpzme37xbCDdNTxU7O9eb5+LB4= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.13.1/go.mod h1:IYus9qsFobWIc2YVwe/WPjcnyCkPKtnHAqUYeebc8z0= github.com/Azure/azure-sdk-for-go/sdk/azidentity/cache v0.3.2 h1:yz1bePFlP5Vws5+8ez6T3HWXPmwOK7Yvq8QxDBD3SKY= @@ -40,15 +40,15 @@ github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/crypto v0.47.0 h1:V6e3FRj+n4dbpw86FJ8Fv7XVOql7TEwpHapKoMJ/GO8= +golang.org/x/crypto v0.47.0/go.mod h1:ff3Y9VzzKbwSSEzWqJsJVBnWmRwRSHt/6Op5n9bQc4A= +golang.org/x/net v0.49.0 h1:eeHFmOGUTtaaPSGNmjBKpbng9MulQsJURQUAfUwY++o= +golang.org/x/net v0.49.0/go.mod h1:/ysNB2EvaqvesRkuLAyjI1ycPZlQHM3q01F02UY/MV8= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.40.0 h1:DBZZqJ2Rkml6QMQsZywtnjnnGvHza6BTfYFWY9kjEWQ= +golang.org/x/sys v0.40.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.33.0 h1:B3njUFyqtHDUI5jMn1YIr5B0IE2U0qck04r6d4KPAxE= +golang.org/x/text v0.33.0/go.mod h1:LuMebE6+rBincTi9+xWTY8TztLzKHc/9C1uBCG27+q8= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/interfaces.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/interfaces.go new file mode 100644 index 000000000000..0645cfd4fdf7 --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/interfaces.go @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armredisenterprise + +// MigrationPropertiesClassification provides polymorphic access to related types. +// Call the interface's GetMigrationProperties() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureCacheForRedisMigrationProperties, *MigrationProperties +type MigrationPropertiesClassification interface { + // GetMigrationProperties returns the MigrationProperties content of the underlying type. + GetMigrationProperties() *MigrationProperties +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client.go new file mode 100644 index 000000000000..c0e45177b7ba --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client.go @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armredisenterprise + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// MigrationClient contains the methods for the Migration group. +// Don't use this type directly, use NewMigrationClient() instead. +type MigrationClient struct { + internal *arm.Client + subscriptionID string +} + +// NewMigrationClient creates a new instance of MigrationClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - Contains optional client configuration. Pass nil to accept the default values. +func NewMigrationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MigrationClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &MigrationClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// BeginCancel - Cancel or rollback the migration operation in a Redis Enterprise cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, +// 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens +// - options - MigrationClientBeginCancelOptions contains the optional parameters for the MigrationClient.BeginCancel method. +func (client *MigrationClient) BeginCancel(ctx context.Context, resourceGroupName string, clusterName string, options *MigrationClientBeginCancelOptions) (*runtime.Poller[MigrationClientCancelResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancel(ctx, resourceGroupName, clusterName, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MigrationClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MigrationClientCancelResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Cancel - Cancel or rollback the migration operation in a Redis Enterprise cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +func (client *MigrationClient) cancel(ctx context.Context, resourceGroupName string, clusterName string, options *MigrationClientBeginCancelOptions) (*http.Response, error) { + var err error + const operationName = "MigrationClient.BeginCancel" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.cancelCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// cancelCreateRequest creates the Cancel request. +func (client *MigrationClient) cancelCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *MigrationClientBeginCancelOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default/cancel" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets information about a migration in a Redis Enterprise cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, +// 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens +// - options - MigrationClientGetOptions contains the optional parameters for the MigrationClient.Get method. +func (client *MigrationClient) Get(ctx context.Context, resourceGroupName string, clusterName string, options *MigrationClientGetOptions) (MigrationClientGetResponse, error) { + var err error + const operationName = "MigrationClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, clusterName, options) + if err != nil { + return MigrationClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return MigrationClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return MigrationClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *MigrationClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *MigrationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *MigrationClient) getHandleResponse(resp *http.Response) (MigrationClientGetResponse, error) { + result := MigrationClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.Migration); err != nil { + return MigrationClientGetResponse{}, err + } + return result, nil +} + +// NewListPager - Gets information about all migrations attempts in a Redis Enterprise cluster. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, +// 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens +// - options - MigrationClientListOptions contains the optional parameters for the MigrationClient.NewListPager method. +func (client *MigrationClient) NewListPager(resourceGroupName string, clusterName string, options *MigrationClientListOptions) *runtime.Pager[MigrationClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[MigrationClientListResponse]{ + More: func(page MigrationClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *MigrationClientListResponse) (MigrationClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "MigrationClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + }, nil) + if err != nil { + return MigrationClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *MigrationClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *MigrationClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *MigrationClient) listHandleResponse(resp *http.Response) (MigrationClientListResponse, error) { + result := MigrationClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.MigrationList); err != nil { + return MigrationClientListResponse{}, err + } + return result, nil +} + +// BeginStart - Starts a new migration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, +// 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens +// - parameters - Parameters supplied to start a migration operation. +// - options - MigrationClientBeginStartOptions contains the optional parameters for the MigrationClient.BeginStart method. +func (client *MigrationClient) BeginStart(ctx context.Context, resourceGroupName string, clusterName string, parameters Migration, options *MigrationClientBeginStartOptions) (*runtime.Poller[MigrationClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[MigrationClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaOriginalURI, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[MigrationClientStartResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// Start - Starts a new migration +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2025-08-01-preview +func (client *MigrationClient) start(ctx context.Context, resourceGroupName string, clusterName string, parameters Migration, options *MigrationClientBeginStartOptions) (*http.Response, error) { + var err error + const operationName = "MigrationClient.BeginStart" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.startCreateRequest(ctx, resourceGroupName, clusterName, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// startCreateRequest creates the Start request. +func (client *MigrationClient) startCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, parameters Migration, _ *MigrationClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/migrations/default" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if clusterName == "" { + return nil, errors.New("parameter clusterName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2025-08-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client_example_test.go new file mode 100644 index 000000000000..32faaf41ed7e --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/migration_client_example_test.go @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armredisenterprise_test + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" +) + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseMigrationCancel.json +func ExampleMigrationClient_BeginCancel() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewMigrationClient().BeginCancel(ctx, "rg1", "cache1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + _, err = poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } +} + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseMigrationGet.json +func ExampleMigrationClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewMigrationClient().Get(ctx, "rg1", "cache1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.MigrationClientGetResponse{ + // Migration: &armredisenterprise.Migration{ + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/migrations"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/migrations/default"), + // Properties: &armredisenterprise.AzureCacheForRedisMigrationProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // ProvisioningState: to.Ptr(armredisenterprise.MigrationProvisioningStateInProgress), + // SkipDataMigration: to.Ptr(true), + // SourceResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1"), + // SourceType: to.Ptr(armredisenterprise.SourceTypeAzureCacheForRedis), + // StatusDetails: to.Ptr(""), + // SwitchDNS: to.Ptr(true), + // TargetResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // }, + // }, + // } +} + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseMigrationList.json +func ExampleMigrationClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewMigrationClient().NewListPager("rg1", "cache1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armredisenterprise.MigrationClientListResponse{ + // MigrationList: armredisenterprise.MigrationList{ + // Value: []*armredisenterprise.Migration{ + // { + // Name: to.Ptr("cache1/default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/migrations"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/migrations/default"), + // Properties: &armredisenterprise.AzureCacheForRedisMigrationProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // ProvisioningState: to.Ptr(armredisenterprise.MigrationProvisioningStateInProgress), + // SkipDataMigration: to.Ptr(true), + // SourceResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1"), + // SourceType: to.Ptr(armredisenterprise.SourceTypeAzureCacheForRedis), + // StatusDetails: to.Ptr(""), + // SwitchDNS: to.Ptr(true), + // TargetResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // }, + // }, + // }, + // }, + // } + } +} + +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseMigrationStart.json +func ExampleMigrationClient_BeginStart() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewMigrationClient().BeginStart(ctx, "rg1", "cache1", armredisenterprise.Migration{ + Properties: &armredisenterprise.AzureCacheForRedisMigrationProperties{ + SkipDataMigration: to.Ptr(true), + SourceResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1"), + SourceType: to.Ptr(armredisenterprise.SourceTypeAzureCacheForRedis), + SwitchDNS: to.Ptr(true), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.MigrationClientStartResponse{ + // Migration: &armredisenterprise.Migration{ + // Name: to.Ptr("default"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/migrations"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/migrations/default"), + // Properties: &armredisenterprise.AzureCacheForRedisMigrationProperties{ + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-01T12:00:00Z"); return t}()), + // ProvisioningState: to.Ptr(armredisenterprise.MigrationProvisioningState("Completed")), + // SkipDataMigration: to.Ptr(true), + // SourceResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redis/cache1"), + // SourceType: to.Ptr(armredisenterprise.SourceTypeAzureCacheForRedis), + // StatusDetails: to.Ptr(""), + // SwitchDNS: to.Ptr(true), + // TargetResourceID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1"), + // }, + // }, + // } +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/models.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/models.go index 6bdd3bf6327d..8e4a8a4aa6bb 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/models.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/models.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -27,16 +26,19 @@ type AccessPolicyAssignment struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } // AccessPolicyAssignmentList - The response of a list-all operation. type AccessPolicyAssignmentList struct { - // List of access policy assignments. + // REQUIRED; The AccessPolicyAssignment items on this page Value []*AccessPolicyAssignment - // READ-ONLY; The URI to fetch the next page of results. + // The link to the next page of items NextLink *string } @@ -58,6 +60,50 @@ type AccessPolicyAssignmentPropertiesUser struct { ObjectID *string } +// AzureCacheForRedisMigrationProperties - Properties for Redis Enterprise migration operation for Azure Cache for Redis. +type AzureCacheForRedisMigrationProperties struct { + // REQUIRED; Sets whether the data is migrated from source to target or not. This property must be true during the preview. + SkipDataMigration *bool + + // REQUIRED; The source resource ID to migrate from. This is the resource ID of the Azure Cache for Redis. + SourceResourceID *string + + // CONSTANT; Describes the source of the migration operation. + // Field has constant value SourceTypeAzureCacheForRedis, any specified value is ignored. + SourceType *SourceType + + // REQUIRED; Sets whether the DNS is switched automatically after the data is transferred from the source cache to the target + // cache. This property must be true during the preview. + SwitchDNS *bool + + // READ-ONLY; The timestamp when the migration operation was created. + CreationTime *time.Time + + // READ-ONLY; The timestamp when the migration operation was last updated. + LastModifiedTime *time.Time + + // READ-ONLY; Current provisioning status of the migration + ProvisioningState *MigrationProvisioningState + + // READ-ONLY; Additional details about the migration operation's status in free text format. + StatusDetails *string + + // READ-ONLY; The Azure resource ID of the Azure Managed Redis destination cache to migrate. + TargetResourceID *string +} + +// GetMigrationProperties implements the MigrationPropertiesClassification interface for type AzureCacheForRedisMigrationProperties. +func (a *AzureCacheForRedisMigrationProperties) GetMigrationProperties() *MigrationProperties { + return &MigrationProperties{ + CreationTime: a.CreationTime, + LastModifiedTime: a.LastModifiedTime, + ProvisioningState: a.ProvisioningState, + SourceType: a.SourceType, + StatusDetails: a.StatusDetails, + TargetResourceID: a.TargetResourceID, + } +} + // Cluster - Describes the Redis Enterprise cluster type Cluster struct { // REQUIRED; The geo-location where the resource lives @@ -75,7 +121,7 @@ type Cluster struct { // Resource tags. Tags map[string]*string - // The Availability Zones where this cluster will be deployed. + // The availability zones. Zones []*string // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -87,23 +133,32 @@ type Cluster struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// ClusterCommonProperties - Properties of Redis Enterprise clusters, as opposed to general resource properties like location, -// tags -type ClusterCommonProperties struct { +// ClusterCreateProperties - Properties of Redis Enterprise clusters for create operations +type ClusterCreateProperties struct { + // REQUIRED; Whether or not public network traffic can access the Redis cluster. Only 'Enabled' or 'Disabled' can be set. + // null is returned only for clusters created using an old API version which do not have this property and cannot be set. + PublicNetworkAccess *PublicNetworkAccess + // Encryption-at-rest configuration for the cluster. - Encryption *ClusterCommonPropertiesEncryption + Encryption *ClusterPropertiesEncryption // Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, // and increases the risk of data loss. HighAvailability *HighAvailability + // Cluster-level maintenance configuration. + MaintenanceConfiguration *MaintenanceConfiguration + // The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS - // 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are - // mentioned only for the sake of consistency with old API versions. + // 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency + // with old API versions. MinimumTLSVersion *TLSVersion // READ-ONLY; DNS name of the cluster endpoint @@ -125,80 +180,43 @@ type ClusterCommonProperties struct { ResourceState *ResourceState } -// ClusterCommonPropertiesEncryption - Encryption-at-rest configuration for the cluster. -type ClusterCommonPropertiesEncryption struct { +// ClusterList - The response of a list-all operation. +type ClusterList struct { + // REQUIRED; The Cluster items on this page + Value []*Cluster + + // The link to the next page of items + NextLink *string +} + +// ClusterPropertiesEncryption - Encryption-at-rest configuration for the cluster. +type ClusterPropertiesEncryption struct { // All Customer-managed key encryption properties for the resource. Set this to an empty object to use Microsoft-managed key // encryption. - CustomerManagedKeyEncryption *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption + CustomerManagedKeyEncryption *ClusterPropertiesEncryptionCustomerManagedKeyEncryption } -// ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption - All Customer-managed key encryption properties for the -// resource. Set this to an empty object to use Microsoft-managed key encryption. -type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption struct { +// ClusterPropertiesEncryptionCustomerManagedKeyEncryption - All Customer-managed key encryption properties for the resource. +// Set this to an empty object to use Microsoft-managed key encryption. +type ClusterPropertiesEncryptionCustomerManagedKeyEncryption struct { // All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. - KeyEncryptionKeyIdentity *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity + KeyEncryptionKeyIdentity *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity // Key encryption key Url, versioned only. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 KeyEncryptionKeyURL *string } -// ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity - All identity configuration for Customer-managed -// key settings defining which identity should be used to auth to Key Vault. -type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity struct { +// ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity - All identity configuration for Customer-managed key +// settings defining which identity should be used to auth to Key Vault. +type ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity struct { // Only userAssignedIdentity is supported in this API version; other types may be supported in the future IdentityType *CmkIdentityType - // User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. + // User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions//resourceGroups//providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. UserAssignedIdentityResourceID *string } -// ClusterCreateProperties - Properties of Redis Enterprise clusters for create operations -type ClusterCreateProperties struct { - // REQUIRED; Whether or not public network traffic can access the Redis cluster. Only 'Enabled' or 'Disabled' can be set. - // null is returned only for clusters created using an old API version which do not have this - // property and cannot be set. - PublicNetworkAccess *PublicNetworkAccess - - // Encryption-at-rest configuration for the cluster. - Encryption *ClusterCommonPropertiesEncryption - - // Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, - // and increases the risk of data loss. - HighAvailability *HighAvailability - - // The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS - // 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are - // mentioned only for the sake of consistency with old API versions. - MinimumTLSVersion *TLSVersion - - // READ-ONLY; DNS name of the cluster endpoint - HostName *string - - // READ-ONLY; List of private endpoint connections associated with the specified Redis Enterprise cluster - PrivateEndpointConnections []*PrivateEndpointConnection - - // READ-ONLY; Current provisioning status of the cluster - ProvisioningState *ProvisioningState - - // READ-ONLY; Version of redis the cluster supports, e.g. '6' - RedisVersion *string - - // READ-ONLY; Explains the current redundancy strategy of the cluster, which affects the expected SLA. - RedundancyMode *RedundancyMode - - // READ-ONLY; Current resource status of the cluster - ResourceState *ResourceState -} - -// ClusterList - The response of a list-all operation. -type ClusterList struct { - // List of clusters. - Value []*Cluster - - // READ-ONLY; The URI to fetch the next page of results. - NextLink *string -} - // ClusterUpdate - A partial update to the Redis Enterprise cluster type ClusterUpdate struct { // The identity of the resource. @@ -217,20 +235,22 @@ type ClusterUpdate struct { // ClusterUpdateProperties - Properties of Redis Enterprise clusters for update operations type ClusterUpdateProperties struct { // Encryption-at-rest configuration for the cluster. - Encryption *ClusterCommonPropertiesEncryption + Encryption *ClusterPropertiesEncryption // Enabled by default. If highAvailability is disabled, the data set is not replicated. This affects the availability SLA, // and increases the risk of data loss. HighAvailability *HighAvailability + // Cluster-level maintenance configuration. + MaintenanceConfiguration *MaintenanceConfiguration + // The minimum TLS version for the cluster to support, e.g. '1.2'. Newer versions can be added in the future. Note that TLS - // 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are - // mentioned only for the sake of consistency with old API versions. + // 1.0 and TLS 1.1 are now completely obsolete -- you cannot use them. They are mentioned only for the sake of consistency + // with old API versions. MinimumTLSVersion *TLSVersion // Whether or not public network traffic can access the Redis cluster. Only 'Enabled' or 'Disabled' can be set. null is returned - // only for clusters created using an old API version which do not have this - // property and cannot be set. + // only for clusters created using an old API version which do not have this property and cannot be set. PublicNetworkAccess *PublicNetworkAccess // READ-ONLY; DNS name of the cluster endpoint @@ -270,70 +290,17 @@ type Database struct { Type *string } -// DatabaseCommonProperties - Properties of Redis Enterprise databases, as opposed to general resource properties like location, -// tags -type DatabaseCommonProperties struct { - // This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database - // is created. - AccessKeysAuthentication *AccessKeysAuthentication - - // Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. - ClientProtocol *Protocol - - // Clustering policy - default is OSSCluster. This property can be updated only if the current value is NoCluster. If the - // value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting - // the database. - ClusteringPolicy *ClusteringPolicy - - // Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade - DeferUpgrade *DeferUpgradeSetting - - // Redis eviction policy - default is VolatileLRU - EvictionPolicy *EvictionPolicy - - // Optional set of properties to configure geo replication for this database. - GeoReplication *DatabaseCommonPropertiesGeoReplication - - // Optional set of redis modules to enable in this database - modules can only be added at creation time. - Modules []*Module - - // Persistence settings - Persistence *Persistence - - // TCP port of the database endpoint. Specified at create time. Defaults to an available port. - Port *int32 - - // READ-ONLY; Current provisioning status of the database - ProvisioningState *ProvisioningState - - // READ-ONLY; Version of Redis the database is running on, e.g. '6.0' - RedisVersion *string - - // READ-ONLY; Current resource status of the database - ResourceState *ResourceState -} - -// DatabaseCommonPropertiesGeoReplication - Optional set of properties to configure geo replication for this database. -type DatabaseCommonPropertiesGeoReplication struct { - // Name for the group of linked database resources - GroupNickname *string - - // List of database resources to link with this database - LinkedDatabases []*LinkedDatabase -} - // DatabaseCreateProperties - Properties for creating Redis Enterprise databases type DatabaseCreateProperties struct { // This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database - // is created. + // is created. Default is Disabled. AccessKeysAuthentication *AccessKeysAuthentication // Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. ClientProtocol *Protocol // Clustering policy - default is OSSCluster. This property can be updated only if the current value is NoCluster. If the - // value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting - // the database. + // value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting the database. ClusteringPolicy *ClusteringPolicy // Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade @@ -343,7 +310,7 @@ type DatabaseCreateProperties struct { EvictionPolicy *EvictionPolicy // Optional set of properties to configure geo replication for this database. - GeoReplication *DatabaseCommonPropertiesGeoReplication + GeoReplication *DatabasePropertiesGeoReplication // Optional set of redis modules to enable in this database - modules can only be added at creation time. Modules []*Module @@ -366,13 +333,22 @@ type DatabaseCreateProperties struct { // DatabaseList - The response of a list-all operation. type DatabaseList struct { - // List of databases + // REQUIRED; The Database items on this page Value []*Database - // READ-ONLY; The URI to fetch the next page of results. + // The link to the next page of items NextLink *string } +// DatabasePropertiesGeoReplication - Optional set of properties to configure geo replication for this database. +type DatabasePropertiesGeoReplication struct { + // Name for the group of linked database resources + GroupNickname *string + + // List of database resources to link with this database + LinkedDatabases []*LinkedDatabase +} + // DatabaseUpdate - A partial update to the Redis Enterprise database type DatabaseUpdate struct { // Properties of the database. @@ -382,15 +358,14 @@ type DatabaseUpdate struct { // DatabaseUpdateProperties - Properties for updating Redis Enterprise databases type DatabaseUpdateProperties struct { // This property can be Enabled/Disabled to allow or deny access with the current access keys. Can be updated even after database - // is created. + // is created. Default is Disabled. AccessKeysAuthentication *AccessKeysAuthentication // Specifies whether redis clients can connect using TLS-encrypted or plaintext redis protocols. Default is TLS-encrypted. ClientProtocol *Protocol // Clustering policy - default is OSSCluster. This property can be updated only if the current value is NoCluster. If the - // value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting - // the database. + // value is OSSCluster or EnterpriseCluster, it cannot be updated without deleting the database. ClusteringPolicy *ClusteringPolicy // Option to defer upgrade when newest version is released - default is NotDeferred. Learn more: https://aka.ms/redisversionupgrade @@ -400,7 +375,7 @@ type DatabaseUpdateProperties struct { EvictionPolicy *EvictionPolicy // Optional set of properties to configure geo replication for this database. - GeoReplication *DatabaseCommonPropertiesGeoReplication + GeoReplication *DatabasePropertiesGeoReplication // Optional set of redis modules to enable in this database - modules can only be added at creation time. Modules []*Module @@ -448,38 +423,14 @@ type ErrorDetail struct { Target *string } -// ErrorDetailAutoGenerated - The error detail. -type ErrorDetailAutoGenerated struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo - - // READ-ONLY; The error code. - Code *string - - // READ-ONLY; The error details. - Details []*ErrorDetailAutoGenerated - - // READ-ONLY; The error message. - Message *string - - // READ-ONLY; The error target. - Target *string -} - -// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. -// (This also follows the OData error response format.). +// ErrorResponse - Error response +// +// Common error response for all Azure Resource Manager APIs to return error details for failed operations. type ErrorResponse struct { // The error object. Error *ErrorDetail } -// ErrorResponseAutoGenerated - Common error response for all Azure Resource Manager APIs to return error details for failed -// operations. (This also follows the OData error response format.). -type ErrorResponseAutoGenerated struct { - // The error object. - Error *ErrorDetailAutoGenerated -} - // ExportClusterParameters - Parameters for a Redis Enterprise export operation. type ExportClusterParameters struct { // REQUIRED; SAS URI for the target directory to export to @@ -505,8 +456,7 @@ type ForceLinkParametersGeoReplication struct { GroupNickname *string // The resource IDs of the databases that are expected to be linked and included in the replication group. This parameter - // is used to validate that the linking is to the expected (unlinked) part of the - // replication group, if it is splintered. + // is used to validate that the linking is to the expected (unlinked) part of the replication group, if it is splintered. LinkedDatabases []*LinkedDatabase } @@ -531,16 +481,39 @@ type LinkedDatabase struct { State *LinkState } +// MaintenanceConfiguration - Cluster-level maintenance configuration. +type MaintenanceConfiguration struct { + // Custom maintenance windows that apply to the cluster. + MaintenanceWindows []*MaintenanceWindow +} + +// MaintenanceWindow - A single custom maintenance window. +type MaintenanceWindow struct { + // REQUIRED; Duration in ISO-8601 format, for example 'PT5H'. + Duration *string + + // REQUIRED; Recurring schedule for the maintenance window. + Schedule *MaintenanceWindowSchedule + + // REQUIRED; Start hour (0-23) in UTC when the maintenance window begins. + StartHourUTC *int32 + + // REQUIRED; Maintenance window type. + Type *MaintenanceWindowType +} + +// MaintenanceWindowSchedule - Schedule details for a maintenance window. +type MaintenanceWindowSchedule struct { + // Day of week. Required when the maintenance window type is 'Weekly'. + DayOfWeek *MaintenanceDayOfWeek +} + // ManagedServiceIdentity - Managed service identity (system assigned and/or user assigned identities) type ManagedServiceIdentity struct { - // REQUIRED; Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + // REQUIRED; The type of managed identity assigned to this resource. 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. + // The identities assigned to this resource by the user. UserAssignedIdentities map[string]*UserAssignedIdentity // READ-ONLY; The service principal ID of the system assigned identity. This property will only be provided for a system assigned @@ -551,28 +524,81 @@ type ManagedServiceIdentity struct { TenantID *string } +// Migration - Describes the current migration operation on a Redis Enterprise cluster. +type Migration struct { + // Properties of the migration operation. + Properties MigrationPropertiesClassification + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string + + // READ-ONLY; The name of the resource + Name *string + + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string +} + +// MigrationList - The response of a list-all migrations. +type MigrationList struct { + // REQUIRED; The Migration items on this page + Value []*Migration + + // The link to the next page of items + NextLink *string +} + +// MigrationProperties - Properties for Redis Enterprise migration operation. +type MigrationProperties struct { + // REQUIRED; Describes the source of the migration operation. + SourceType *SourceType + + // READ-ONLY; The timestamp when the migration operation was created. + CreationTime *time.Time + + // READ-ONLY; The timestamp when the migration operation was last updated. + LastModifiedTime *time.Time + + // READ-ONLY; Current provisioning status of the migration + ProvisioningState *MigrationProvisioningState + + // READ-ONLY; Additional details about the migration operation's status in free text format. + StatusDetails *string + + // READ-ONLY; The Azure resource ID of the Azure Managed Redis destination cache to migrate. + TargetResourceID *string +} + +// GetMigrationProperties implements the MigrationPropertiesClassification interface for type MigrationProperties. +func (m *MigrationProperties) GetMigrationProperties() *MigrationProperties { return m } + // Module - Specifies configuration of a redis module type Module struct { // REQUIRED; The name of the module, e.g. 'RedisBloom', 'RediSearch', 'RedisTimeSeries' Name *string - // Configuration options for the module, e.g. 'ERRORRATE 0.01 INITIALSIZE 400'. + // Configuration options for the module, e.g. 'ERROR_RATE 0.01 INITIAL_SIZE 400'. Args *string // READ-ONLY; The version of the module, e.g. '1.0'. Version *string } -// Operation - Details of a REST API operation, returned from the Resource Provider Operations API +// Operation - REST API Operation +// +// Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. Display *OperationDisplay - // READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + // READ-ONLY; Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. ActionType *ActionType - // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane - // operations. + // READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure + // Resource Manager/control-plane operations. IsDataAction *bool // READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", @@ -584,7 +610,7 @@ type Operation struct { Origin *Origin } -// OperationDisplay - Localized display information for this particular operation. +// OperationDisplay - Localized display information for an operation. type OperationDisplay struct { // READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. Description *string @@ -605,11 +631,11 @@ type OperationDisplay struct { // OperationListResult - A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to // get the next set of results. type OperationListResult struct { - // READ-ONLY; URL to get the next set of operation list results (if there are any). - NextLink *string - - // READ-ONLY; List of operations supported by the resource provider + // REQUIRED; The Operation items on this page Value []*Operation + + // The link to the next page of items + NextLink *string } // OperationStatus - The status of a long-running operation. @@ -649,9 +675,9 @@ type Persistence struct { RdbFrequency *RdbFrequency } -// PrivateEndpoint - The Private Endpoint resource. +// PrivateEndpoint - The private endpoint resource. type PrivateEndpoint struct { - // READ-ONLY; The ARM identifier for Private Endpoint + // READ-ONLY; The resource identifier of the private endpoint ID *string } @@ -666,29 +692,38 @@ type PrivateEndpointConnection struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateEndpointConnectionListResult - List of private endpoint connection associated with the specified storage account +// PrivateEndpointConnectionListResult - The response of a PrivateEndpointConnection list operation. type PrivateEndpointConnectionListResult struct { - // Array of private endpoint connections + // REQUIRED; The PrivateEndpointConnection items on this page Value []*PrivateEndpointConnection + + // The link to the next page of items + NextLink *string } -// PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. +// PrivateEndpointConnectionProperties - Properties of the private endpoint connection. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState - // The resource of private end point. + // The private endpoint resource. PrivateEndpoint *PrivateEndpoint + // READ-ONLY; The group ids for the private endpoint resource. + GroupIDs []*string + // READ-ONLY; The provisioning state of the private endpoint connection resource. ProvisioningState *PrivateEndpointConnectionProvisioningState } -// PrivateLinkResource - A private link resource +// PrivateLinkResource - A private link resource. type PrivateLinkResource struct { // Resource properties. Properties *PrivateLinkResourceProperties @@ -699,19 +734,25 @@ type PrivateLinkResource struct { // READ-ONLY; The name of the resource Name *string + // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" Type *string } -// PrivateLinkResourceListResult - A list of private link resources +// PrivateLinkResourceListResult - A list of private link resources. type PrivateLinkResourceListResult struct { // Array of private link resources Value []*PrivateLinkResource + + // READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string } // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { - // The private link resource Private link DNS zone name. + // The private link resource private link DNS zone name. RequiredZoneNames []*string // READ-ONLY; The private link resource group id. @@ -734,77 +775,21 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointServiceConnectionStatus } -// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a -// location -type ProxyResource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ProxyResourceAutoGenerated - The resource model definition for a Azure Resource Manager proxy resource. It will not have -// tags and a location -type ProxyResourceAutoGenerated struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // RegenerateKeyParameters - Specifies which access keys to reset to a new random value. type RegenerateKeyParameters struct { // REQUIRED; Which access key to regenerate. KeyType *AccessKeyType } -// Resource - Common fields that are returned in the response for all Azure Resource Manager resources -type Resource struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - -// ResourceAutoGenerated - Common fields that are returned in the response for all Azure Resource Manager resources -type ResourceAutoGenerated struct { - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. - SystemData *SystemData - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // SKU parameters supplied to the create Redis Enterprise cluster operation. type SKU struct { - // REQUIRED; The level of Redis Enterprise cluster to deploy. Possible values: ('BalancedB5', 'MemoryOptimizedM10', 'ComputeOptimized_X5', - // etc.). For more information on SKUs see the latest pricing documentation. - // Note that additional SKUs may become supported in the future. + // REQUIRED; The level of Redis Enterprise cluster to deploy. Possible values: ('Balanced_B5', 'MemoryOptimized_M10', 'ComputeOptimized_X5', + // etc.). For more information on SKUs see the latest pricing documentation. Note that additional SKUs may become supported + // in the future. Name *SKUName // This property is only used with Enterprise and EnterpriseFlash SKUs. Determines the size of the cluster. Valid values are - // (2, 4, 6, …) for Enterprise SKUs and (3, 9, 15, …) for EnterpriseFlash SKUs. + // (2, 4, 6, ...) for Enterprise SKUs and (3, 9, 15, ...) for EnterpriseFlash SKUs. Capacity *int32 } @@ -844,25 +829,6 @@ type SystemData struct { LastModifiedByType *CreatedByType } -// TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' -// and a 'location' -type TrackedResource struct { - // REQUIRED; The geo-location where the resource lives - Location *string - - // Resource tags. - Tags map[string]*string - - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string - - // READ-ONLY; The name of the resource - Name *string - - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string -} - // UserAssignedIdentity - User assigned identity properties type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/models_serde.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/models_serde.go index 6270184b3caa..5e1d66243d08 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/models_serde.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/models_serde.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -9,7 +8,9 @@ import ( "encoding/json" "fmt" "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime/datetime" "reflect" + "time" ) // MarshalJSON implements the json.Marshaller interface for type AccessKeys. @@ -49,6 +50,7 @@ func (a AccessPolicyAssignment) MarshalJSON() ([]byte, error) { populate(objectMap, "id", a.ID) populate(objectMap, "name", a.Name) populate(objectMap, "properties", a.Properties) + populate(objectMap, "systemData", a.SystemData) populate(objectMap, "type", a.Type) return json.Marshal(objectMap) } @@ -71,6 +73,9 @@ func (a *AccessPolicyAssignment) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &a.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &a.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &a.Type) delete(rawMsg, key) @@ -175,6 +180,65 @@ func (a *AccessPolicyAssignmentPropertiesUser) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureCacheForRedisMigrationProperties. +func (a AzureCacheForRedisMigrationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTime[datetime.RFC3339](objectMap, "creationTime", a.CreationTime) + populateTime[datetime.RFC3339](objectMap, "lastModifiedTime", a.LastModifiedTime) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "skipDataMigration", a.SkipDataMigration) + populate(objectMap, "sourceResourceId", a.SourceResourceID) + objectMap["sourceType"] = SourceTypeAzureCacheForRedis + populate(objectMap, "statusDetails", a.StatusDetails) + populate(objectMap, "switchDns", a.SwitchDNS) + populate(objectMap, "targetResourceId", a.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureCacheForRedisMigrationProperties. +func (a *AzureCacheForRedisMigrationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "creationTime": + err = unpopulateTime[datetime.RFC3339](val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedTime", &a.LastModifiedTime) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + delete(rawMsg, key) + case "skipDataMigration": + err = unpopulate(val, "SkipDataMigration", &a.SkipDataMigration) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, "SourceType", &a.SourceType) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &a.StatusDetails) + delete(rawMsg, key) + case "switchDns": + err = unpopulate(val, "SwitchDNS", &a.SwitchDNS) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &a.TargetResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type Cluster. func (c Cluster) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -185,6 +249,7 @@ func (c Cluster) MarshalJSON() ([]byte, error) { populate(objectMap, "name", c.Name) populate(objectMap, "properties", c.Properties) populate(objectMap, "sku", c.SKU) + populate(objectMap, "systemData", c.SystemData) populate(objectMap, "tags", c.Tags) populate(objectMap, "type", c.Type) populate(objectMap, "zones", c.Zones) @@ -221,6 +286,9 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { case "sku": err = unpopulate(val, "SKU", &c.SKU) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &c.SystemData) + delete(rawMsg, key) case "tags": err = unpopulate(val, "Tags", &c.Tags) delete(rawMsg, key) @@ -238,23 +306,25 @@ func (c *Cluster) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterCommonProperties. -func (c ClusterCommonProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterCreateProperties. +func (c ClusterCreateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "encryption", c.Encryption) populate(objectMap, "highAvailability", c.HighAvailability) populate(objectMap, "hostName", c.HostName) + populate(objectMap, "maintenanceConfiguration", c.MaintenanceConfiguration) populate(objectMap, "minimumTlsVersion", c.MinimumTLSVersion) populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections) populate(objectMap, "provisioningState", c.ProvisioningState) + populate(objectMap, "publicNetworkAccess", c.PublicNetworkAccess) populate(objectMap, "redisVersion", c.RedisVersion) populate(objectMap, "redundancyMode", c.RedundancyMode) populate(objectMap, "resourceState", c.ResourceState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCommonProperties. -func (c *ClusterCommonProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCreateProperties. +func (c *ClusterCreateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -271,6 +341,9 @@ func (c *ClusterCommonProperties) UnmarshalJSON(data []byte) error { case "hostName": err = unpopulate(val, "HostName", &c.HostName) delete(rawMsg, key) + case "maintenanceConfiguration": + err = unpopulate(val, "MaintenanceConfiguration", &c.MaintenanceConfiguration) + delete(rawMsg, key) case "minimumTlsVersion": err = unpopulate(val, "MinimumTLSVersion", &c.MinimumTLSVersion) delete(rawMsg, key) @@ -280,6 +353,9 @@ func (c *ClusterCommonProperties) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &c.PublicNetworkAccess) + delete(rawMsg, key) case "redisVersion": err = unpopulate(val, "RedisVersion", &c.RedisVersion) delete(rawMsg, key) @@ -297,43 +373,16 @@ func (c *ClusterCommonProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterCommonPropertiesEncryption. -func (c ClusterCommonPropertiesEncryption) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "customerManagedKeyEncryption", c.CustomerManagedKeyEncryption) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCommonPropertiesEncryption. -func (c *ClusterCommonPropertiesEncryption) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "customerManagedKeyEncryption": - err = unpopulate(val, "CustomerManagedKeyEncryption", &c.CustomerManagedKeyEncryption) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption. -func (c ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterList. +func (c ClusterList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "keyEncryptionKeyIdentity", c.KeyEncryptionKeyIdentity) - populate(objectMap, "keyEncryptionKeyUrl", c.KeyEncryptionKeyURL) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption. -func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterList. +func (c *ClusterList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -341,11 +390,11 @@ func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption) Unmarsha for key, val := range rawMsg { var err error switch key { - case "keyEncryptionKeyIdentity": - err = unpopulate(val, "KeyEncryptionKeyIdentity", &c.KeyEncryptionKeyIdentity) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "keyEncryptionKeyUrl": - err = unpopulate(val, "KeyEncryptionKeyURL", &c.KeyEncryptionKeyURL) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { @@ -355,16 +404,15 @@ func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryption) Unmarsha return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity. -func (c ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterPropertiesEncryption. +func (c ClusterPropertiesEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "identityType", c.IdentityType) - populate(objectMap, "userAssignedIdentityResourceId", c.UserAssignedIdentityResourceID) + populate(objectMap, "customerManagedKeyEncryption", c.CustomerManagedKeyEncryption) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity. -func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesEncryption. +func (c *ClusterPropertiesEncryption) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -372,11 +420,8 @@ func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentit for key, val := range rawMsg { var err error switch key { - case "identityType": - err = unpopulate(val, "IdentityType", &c.IdentityType) - delete(rawMsg, key) - case "userAssignedIdentityResourceId": - err = unpopulate(val, "UserAssignedIdentityResourceID", &c.UserAssignedIdentityResourceID) + case "customerManagedKeyEncryption": + err = unpopulate(val, "CustomerManagedKeyEncryption", &c.CustomerManagedKeyEncryption) delete(rawMsg, key) } if err != nil { @@ -386,24 +431,16 @@ func (c *ClusterCommonPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentit return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterCreateProperties. -func (c ClusterCreateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterPropertiesEncryptionCustomerManagedKeyEncryption. +func (c ClusterPropertiesEncryptionCustomerManagedKeyEncryption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "encryption", c.Encryption) - populate(objectMap, "highAvailability", c.HighAvailability) - populate(objectMap, "hostName", c.HostName) - populate(objectMap, "minimumTlsVersion", c.MinimumTLSVersion) - populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections) - populate(objectMap, "provisioningState", c.ProvisioningState) - populate(objectMap, "publicNetworkAccess", c.PublicNetworkAccess) - populate(objectMap, "redisVersion", c.RedisVersion) - populate(objectMap, "redundancyMode", c.RedundancyMode) - populate(objectMap, "resourceState", c.ResourceState) + populate(objectMap, "keyEncryptionKeyIdentity", c.KeyEncryptionKeyIdentity) + populate(objectMap, "keyEncryptionKeyUrl", c.KeyEncryptionKeyURL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterCreateProperties. -func (c *ClusterCreateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesEncryptionCustomerManagedKeyEncryption. +func (c *ClusterPropertiesEncryptionCustomerManagedKeyEncryption) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -411,35 +448,11 @@ func (c *ClusterCreateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "encryption": - err = unpopulate(val, "Encryption", &c.Encryption) - delete(rawMsg, key) - case "highAvailability": - err = unpopulate(val, "HighAvailability", &c.HighAvailability) - delete(rawMsg, key) - case "hostName": - err = unpopulate(val, "HostName", &c.HostName) - delete(rawMsg, key) - case "minimumTlsVersion": - err = unpopulate(val, "MinimumTLSVersion", &c.MinimumTLSVersion) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &c.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &c.ProvisioningState) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &c.PublicNetworkAccess) - delete(rawMsg, key) - case "redisVersion": - err = unpopulate(val, "RedisVersion", &c.RedisVersion) - delete(rawMsg, key) - case "redundancyMode": - err = unpopulate(val, "RedundancyMode", &c.RedundancyMode) + case "keyEncryptionKeyIdentity": + err = unpopulate(val, "KeyEncryptionKeyIdentity", &c.KeyEncryptionKeyIdentity) delete(rawMsg, key) - case "resourceState": - err = unpopulate(val, "ResourceState", &c.ResourceState) + case "keyEncryptionKeyUrl": + err = unpopulate(val, "KeyEncryptionKeyURL", &c.KeyEncryptionKeyURL) delete(rawMsg, key) } if err != nil { @@ -449,16 +462,16 @@ func (c *ClusterCreateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ClusterList. -func (c ClusterList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity. +func (c ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", c.NextLink) - populate(objectMap, "value", c.Value) + populate(objectMap, "identityType", c.IdentityType) + populate(objectMap, "userAssignedIdentityResourceId", c.UserAssignedIdentityResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterList. -func (c *ClusterList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity. +func (c *ClusterPropertiesEncryptionCustomerManagedKeyEncryptionKeyIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", c, err) @@ -466,11 +479,11 @@ func (c *ClusterList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &c.NextLink) + case "identityType": + err = unpopulate(val, "IdentityType", &c.IdentityType) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &c.Value) + case "userAssignedIdentityResourceId": + err = unpopulate(val, "UserAssignedIdentityResourceID", &c.UserAssignedIdentityResourceID) delete(rawMsg, key) } if err != nil { @@ -525,6 +538,7 @@ func (c ClusterUpdateProperties) MarshalJSON() ([]byte, error) { populate(objectMap, "encryption", c.Encryption) populate(objectMap, "highAvailability", c.HighAvailability) populate(objectMap, "hostName", c.HostName) + populate(objectMap, "maintenanceConfiguration", c.MaintenanceConfiguration) populate(objectMap, "minimumTlsVersion", c.MinimumTLSVersion) populate(objectMap, "privateEndpointConnections", c.PrivateEndpointConnections) populate(objectMap, "provisioningState", c.ProvisioningState) @@ -553,6 +567,9 @@ func (c *ClusterUpdateProperties) UnmarshalJSON(data []byte) error { case "hostName": err = unpopulate(val, "HostName", &c.HostName) delete(rawMsg, key) + case "maintenanceConfiguration": + err = unpopulate(val, "MaintenanceConfiguration", &c.MaintenanceConfiguration) + delete(rawMsg, key) case "minimumTlsVersion": err = unpopulate(val, "MinimumTLSVersion", &c.MinimumTLSVersion) delete(rawMsg, key) @@ -625,8 +642,8 @@ func (d *Database) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseCommonProperties. -func (d DatabaseCommonProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseCreateProperties. +func (d DatabaseCreateProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "accessKeysAuthentication", d.AccessKeysAuthentication) populate(objectMap, "clientProtocol", d.ClientProtocol) @@ -643,8 +660,8 @@ func (d DatabaseCommonProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseCommonProperties. -func (d *DatabaseCommonProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseCreateProperties. +func (d *DatabaseCreateProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -696,57 +713,16 @@ func (d *DatabaseCommonProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseCommonPropertiesGeoReplication. -func (d DatabaseCommonPropertiesGeoReplication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "groupNickname", d.GroupNickname) - populate(objectMap, "linkedDatabases", d.LinkedDatabases) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseCommonPropertiesGeoReplication. -func (d *DatabaseCommonPropertiesGeoReplication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "groupNickname": - err = unpopulate(val, "GroupNickname", &d.GroupNickname) - delete(rawMsg, key) - case "linkedDatabases": - err = unpopulate(val, "LinkedDatabases", &d.LinkedDatabases) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseCreateProperties. -func (d DatabaseCreateProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabaseList. +func (d DatabaseList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "accessKeysAuthentication", d.AccessKeysAuthentication) - populate(objectMap, "clientProtocol", d.ClientProtocol) - populate(objectMap, "clusteringPolicy", d.ClusteringPolicy) - populate(objectMap, "deferUpgrade", d.DeferUpgrade) - populate(objectMap, "evictionPolicy", d.EvictionPolicy) - populate(objectMap, "geoReplication", d.GeoReplication) - populate(objectMap, "modules", d.Modules) - populate(objectMap, "persistence", d.Persistence) - populate(objectMap, "port", d.Port) - populate(objectMap, "provisioningState", d.ProvisioningState) - populate(objectMap, "redisVersion", d.RedisVersion) - populate(objectMap, "resourceState", d.ResourceState) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseCreateProperties. -func (d *DatabaseCreateProperties) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseList. +func (d *DatabaseList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -754,41 +730,11 @@ func (d *DatabaseCreateProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "accessKeysAuthentication": - err = unpopulate(val, "AccessKeysAuthentication", &d.AccessKeysAuthentication) - delete(rawMsg, key) - case "clientProtocol": - err = unpopulate(val, "ClientProtocol", &d.ClientProtocol) - delete(rawMsg, key) - case "clusteringPolicy": - err = unpopulate(val, "ClusteringPolicy", &d.ClusteringPolicy) - delete(rawMsg, key) - case "deferUpgrade": - err = unpopulate(val, "DeferUpgrade", &d.DeferUpgrade) - delete(rawMsg, key) - case "evictionPolicy": - err = unpopulate(val, "EvictionPolicy", &d.EvictionPolicy) - delete(rawMsg, key) - case "geoReplication": - err = unpopulate(val, "GeoReplication", &d.GeoReplication) - delete(rawMsg, key) - case "modules": - err = unpopulate(val, "Modules", &d.Modules) - delete(rawMsg, key) - case "persistence": - err = unpopulate(val, "Persistence", &d.Persistence) - delete(rawMsg, key) - case "port": - err = unpopulate(val, "Port", &d.Port) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &d.ProvisioningState) - delete(rawMsg, key) - case "redisVersion": - err = unpopulate(val, "RedisVersion", &d.RedisVersion) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) delete(rawMsg, key) - case "resourceState": - err = unpopulate(val, "ResourceState", &d.ResourceState) + case "value": + err = unpopulate(val, "Value", &d.Value) delete(rawMsg, key) } if err != nil { @@ -798,16 +744,16 @@ func (d *DatabaseCreateProperties) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type DatabaseList. -func (d DatabaseList) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type DatabasePropertiesGeoReplication. +func (d DatabasePropertiesGeoReplication) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) + populate(objectMap, "groupNickname", d.GroupNickname) + populate(objectMap, "linkedDatabases", d.LinkedDatabases) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseList. -func (d *DatabaseList) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabasePropertiesGeoReplication. +func (d *DatabasePropertiesGeoReplication) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", d, err) @@ -815,11 +761,11 @@ func (d *DatabaseList) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "nextLink": - err = unpopulate(val, "NextLink", &d.NextLink) + case "groupNickname": + err = unpopulate(val, "GroupNickname", &d.GroupNickname) delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &d.Value) + case "linkedDatabases": + err = unpopulate(val, "LinkedDatabases", &d.LinkedDatabases) delete(rawMsg, key) } if err != nil { @@ -1001,49 +947,6 @@ func (e *ErrorDetail) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetailAutoGenerated. -func (e ErrorDetailAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetailAutoGenerated. -func (e *ErrorDetailAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "additionalInfo": - err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) - delete(rawMsg, key) - case "code": - err = unpopulate(val, "Code", &e.Code) - delete(rawMsg, key) - case "details": - err = unpopulate(val, "Details", &e.Details) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &e.Message) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &e.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ErrorResponse. func (e ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1071,33 +974,6 @@ func (e *ErrorResponse) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseAutoGenerated. -func (e ErrorResponseAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "error", e.Error) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseAutoGenerated. -func (e *ErrorResponseAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "error": - err = unpopulate(val, "Error", &e.Error) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type ExportClusterParameters. func (e ExportClusterParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1217,96 +1093,304 @@ func (f ForceUnlinkParameters) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ForceUnlinkParameters. -func (f *ForceUnlinkParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ForceUnlinkParameters. +func (f *ForceUnlinkParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ids": + err = unpopulate(val, "IDs", &f.IDs) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportClusterParameters. +func (i ImportClusterParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sasUris", i.SasUris) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportClusterParameters. +func (i *ImportClusterParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sasUris": + err = unpopulate(val, "SasUris", &i.SasUris) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LinkedDatabase. +func (l LinkedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "state", l.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedDatabase. +func (l *LinkedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &l.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceConfiguration. +func (m MaintenanceConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maintenanceWindows", m.MaintenanceWindows) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceConfiguration. +func (m *MaintenanceConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "maintenanceWindows": + err = unpopulate(val, "MaintenanceWindows", &m.MaintenanceWindows) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindow. +func (m MaintenanceWindow) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "duration", m.Duration) + populate(objectMap, "schedule", m.Schedule) + populate(objectMap, "startHourUtc", m.StartHourUTC) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindow. +func (m *MaintenanceWindow) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &m.Schedule) + delete(rawMsg, key) + case "startHourUtc": + err = unpopulate(val, "StartHourUTC", &m.StartHourUTC) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowSchedule. +func (m MaintenanceWindowSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowSchedule. +func (m *MaintenanceWindowSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. +func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", m.PrincipalID) + populate(objectMap, "tenantId", m.TenantID) + populate(objectMap, "type", m.Type) + populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. +func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "ids": - err = unpopulate(val, "IDs", &f.IDs) + case "principalId": + err = unpopulate(val, "PrincipalID", &m.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", f, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ImportClusterParameters. -func (i ImportClusterParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type Migration. +func (m Migration) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "sasUris", i.SasUris) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ImportClusterParameters. -func (i *ImportClusterParameters) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Migration. +func (m *Migration) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "sasUris": - err = unpopulate(val, "SasUris", &i.SasUris) + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + m.Properties, err = unmarshalMigrationPropertiesClassification(val) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LinkedDatabase. -func (l LinkedDatabase) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationList. +func (m MigrationList) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "id", l.ID) - populate(objectMap, "state", l.State) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LinkedDatabase. -func (l *LinkedDatabase) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationList. +func (m *MigrationList) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } for key, val := range rawMsg { var err error switch key { - case "id": - err = unpopulate(val, "ID", &l.ID) + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &l.State) + case "value": + err = unpopulate(val, "Value", &m.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", m, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ManagedServiceIdentity. -func (m ManagedServiceIdentity) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type MigrationProperties. +func (m MigrationProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "principalId", m.PrincipalID) - populate(objectMap, "tenantId", m.TenantID) - populate(objectMap, "type", m.Type) - populate(objectMap, "userAssignedIdentities", m.UserAssignedIdentities) + populateTime[datetime.RFC3339](objectMap, "creationTime", m.CreationTime) + populateTime[datetime.RFC3339](objectMap, "lastModifiedTime", m.LastModifiedTime) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "sourceType", m.SourceType) + populate(objectMap, "statusDetails", m.StatusDetails) + populate(objectMap, "targetResourceId", m.TargetResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServiceIdentity. -func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type MigrationProperties. +func (m *MigrationProperties) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { return fmt.Errorf("unmarshalling type %T: %v", m, err) @@ -1314,17 +1398,23 @@ func (m *ManagedServiceIdentity) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "principalId": - err = unpopulate(val, "PrincipalID", &m.PrincipalID) + case "creationTime": + err = unpopulateTime[datetime.RFC3339](val, "CreationTime", &m.CreationTime) delete(rawMsg, key) - case "tenantId": - err = unpopulate(val, "TenantID", &m.TenantID) + case "lastModifiedTime": + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedTime", &m.LastModifiedTime) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &m.Type) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) delete(rawMsg, key) - case "userAssignedIdentities": - err = unpopulate(val, "UserAssignedIdentities", &m.UserAssignedIdentities) + case "sourceType": + err = unpopulate(val, "SourceType", &m.SourceType) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &m.StatusDetails) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &m.TargetResourceID) delete(rawMsg, key) } if err != nil { @@ -1601,6 +1691,7 @@ func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1623,6 +1714,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1637,6 +1731,7 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -1650,6 +1745,9 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -1664,6 +1762,7 @@ func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -1679,6 +1778,9 @@ func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) case "privateEndpoint": err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) @@ -1702,6 +1804,7 @@ func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { populate(objectMap, "id", p.ID) populate(objectMap, "name", p.Name) populate(objectMap, "properties", p.Properties) + populate(objectMap, "systemData", p.SystemData) populate(objectMap, "type", p.Type) return json.Marshal(objectMap) } @@ -1724,6 +1827,9 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { case "properties": err = unpopulate(val, "Properties", &p.Properties) delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &p.SystemData) + delete(rawMsg, key) case "type": err = unpopulate(val, "Type", &p.Type) delete(rawMsg, key) @@ -1738,6 +1844,7 @@ func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) populate(objectMap, "value", p.Value) return json.Marshal(objectMap) } @@ -1751,6 +1858,9 @@ func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) case "value": err = unpopulate(val, "Value", &p.Value) delete(rawMsg, key) @@ -1832,80 +1942,6 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type ProxyResource. -func (p ProxyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "systemData", p.SystemData) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. -func (p *ProxyResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &p.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ProxyResourceAutoGenerated. -func (p ProxyResourceAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResourceAutoGenerated. -func (p *ProxyResourceAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type RegenerateKeyParameters. func (r RegenerateKeyParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -1933,80 +1969,6 @@ func (r *RegenerateKeyParameters) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. -func (r *Resource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceAutoGenerated. -func (r ResourceAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", r.ID) - populate(objectMap, "name", r.Name) - populate(objectMap, "systemData", r.SystemData) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceAutoGenerated. -func (r *ResourceAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &r.ID) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "systemData": - err = unpopulate(val, "SystemData", &r.SystemData) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type SKU. func (s SKU) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2099,10 +2061,10 @@ func (s *SKUDetailsList) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type SystemData. func (s SystemData) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populateDateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populateTime[datetime.RFC3339](objectMap, "createdAt", s.CreatedAt) populate(objectMap, "createdBy", s.CreatedBy) populate(objectMap, "createdByType", s.CreatedByType) - populateDateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populateTime[datetime.RFC3339](objectMap, "lastModifiedAt", s.LastModifiedAt) populate(objectMap, "lastModifiedBy", s.LastModifiedBy) populate(objectMap, "lastModifiedByType", s.LastModifiedByType) return json.Marshal(objectMap) @@ -2118,7 +2080,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { var err error switch key { case "createdAt": - err = unpopulateDateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + err = unpopulateTime[datetime.RFC3339](val, "CreatedAt", &s.CreatedAt) delete(rawMsg, key) case "createdBy": err = unpopulate(val, "CreatedBy", &s.CreatedBy) @@ -2127,7 +2089,7 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { err = unpopulate(val, "CreatedByType", &s.CreatedByType) delete(rawMsg, key) case "lastModifiedAt": - err = unpopulateDateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + err = unpopulateTime[datetime.RFC3339](val, "LastModifiedAt", &s.LastModifiedAt) delete(rawMsg, key) case "lastModifiedBy": err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) @@ -2143,49 +2105,6 @@ func (s *SystemData) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]any) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TrackedResource. -func (t *TrackedResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, "ID", &t.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &t.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &t.Name) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &t.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &t.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - // MarshalJSON implements the json.Marshaller interface for type UserAssignedIdentity. func (u UserAssignedIdentity) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2227,6 +2146,17 @@ func populate(m map[string]any, k string, v any) { } } +func populateTime[T dateTimeConstraints](m map[string]any, k string, t *time.Time) { + if t == nil { + return + } else if azcore.IsNullValue(t) { + m[k] = nil + } else if !reflect.ValueOf(t).IsNil() { + newTime := T(*t) + m[k] = (*T)(&newTime) + } +} + func populateAny(m map[string]any, k string, v any) { if v == nil { return @@ -2246,3 +2176,20 @@ func unpopulate(data json.RawMessage, fn string, v any) error { } return nil } + +func unpopulateTime[T dateTimeConstraints](data json.RawMessage, fn string, t **time.Time) error { + if data == nil || string(data) == "null" { + return nil + } + var aux T + if err := json.Unmarshal(data, &aux); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + newTime := time.Time(aux) + *t = &newTime + return nil +} + +type dateTimeConstraints interface { + datetime.PlainDate | datetime.PlainTime | datetime.RFC1123 | datetime.RFC3339 | datetime.Unix +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client.go index a6bcbc75242e..f828aae85ce3 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -22,7 +21,7 @@ type OperationsClient struct { // NewOperationsClient creates a new instance of OperationsClient with the specified values. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -36,7 +35,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Lists all of the available REST API operations of the Microsoft.Cache provider. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -69,7 +68,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, _ *Operat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client_example_test.go index 99ac2a55e999..a66c741200dd 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_client_example_test.go @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/OperationsList.json +// Generated from example definition: 2025-08-01-preview/OperationsList.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,26 +33,29 @@ func ExampleOperationsClient_NewListPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.OperationListResult = armredisenterprise.OperationListResult{ - // Value: []*armredisenterprise.Operation{ - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/read"), - // Display: &armredisenterprise.OperationDisplay{ - // Description: to.Ptr("View the Redis Enterprise cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache (read)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache"), + // page = armredisenterprise.OperationsClientListResponse{ + // OperationListResult: armredisenterprise.OperationListResult{ + // Value: []*armredisenterprise.Operation{ + // { + // Name: to.Ptr("Microsoft.Cache/redisEnterprise/read"), + // Display: &armredisenterprise.OperationDisplay{ + // Description: to.Ptr("View the Redis Enterprise cache's settings and configuration in the management portal"), + // Operation: to.Ptr("Manage Redis Enterprise cache (read)"), + // Provider: to.Ptr("Microsoft Cache"), + // Resource: to.Ptr("Redis Enterprise cache"), + // }, // }, - // }, - // { - // Name: to.Ptr("Microsoft.Cache/redisEnterprise/write"), - // Display: &armredisenterprise.OperationDisplay{ - // Description: to.Ptr("Modify the Redis Enterprise cache's settings and configuration in the management portal"), - // Operation: to.Ptr("Manage Redis Enterprise cache (write)"), - // Provider: to.Ptr("Microsoft Cache"), - // Resource: to.Ptr("Redis Enterprise cache"), + // { + // Name: to.Ptr("Microsoft.Cache/redisEnterprise/write"), + // Display: &armredisenterprise.OperationDisplay{ + // Description: to.Ptr("Modify the Redis Enterprise cache's settings and configuration in the management portal"), + // Operation: to.Ptr("Manage Redis Enterprise cache (write)"), + // Provider: to.Ptr("Microsoft Cache"), + // Resource: to.Ptr("Redis Enterprise cache"), + // }, // }, - // }}, + // }, + // }, // } } } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_live_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_live_test.go index 7e46583a4148..450f7c81a438 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_live_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/operations_live_test.go @@ -11,7 +11,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client.go index abce329d188d..5d210e9b745c 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -25,9 +24,9 @@ type OperationsStatusClient struct { } // NewOperationsStatusClient creates a new instance of OperationsStatusClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsStatusClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,8 +42,8 @@ func NewOperationsStatusClient(subscriptionID string, credential azcore.TokenCre // Get - Gets the status of operation. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 -// - location - The name of Azure region. +// Generated from API version 2025-08-01-preview +// - location - The name of the Azure region. // - operationID - The ID of an ongoing async operation. // - options - OperationsStatusClientGetOptions contains the optional parameters for the OperationsStatusClient.Get method. func (client *OperationsStatusClient) Get(ctx context.Context, location string, operationID string, options *OperationsStatusClientGetOptions) (OperationsStatusClientGetResponse, error) { @@ -72,6 +71,10 @@ func (client *OperationsStatusClient) Get(ctx context.Context, location string, // getCreateRequest creates the Get request. func (client *OperationsStatusClient) getCreateRequest(ctx context.Context, location string, operationID string, _ *OperationsStatusClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/providers/Microsoft.Cache/locations/{location}/operationsStatus/{operationId}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if location == "" { return nil, errors.New("parameter location cannot be empty") } @@ -80,16 +83,12 @@ func (client *OperationsStatusClient) getCreateRequest(ctx context.Context, loca return nil, errors.New("parameter operationID cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client_example_test.go index db3fd20a7561..137a8d6e74d7 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/operationsstatus_client_example_test.go @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/OperationsStatusGet.json +// Generated from example definition: 2025-08-01-preview/OperationsStatusGet.json func ExampleOperationsStatusClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -32,11 +29,13 @@ func ExampleOperationsStatusClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armredisenterprise.OperationStatus{ - // Name: to.Ptr("testoperationid"), - // EndTime: to.Ptr("2017-01-01T16:13:13.933Z"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/providers/Microsoft.Cache/locations/westus/operationsStatus/testoperationid"), - // StartTime: to.Ptr("2017-01-01T13:13:13.933Z"), - // Status: to.Ptr("Succeeded"), + // res = armredisenterprise.OperationsStatusClientGetResponse{ + // OperationStatus: &armredisenterprise.OperationStatus{ + // Name: to.Ptr("testoperationid"), + // EndTime: to.Ptr("2017-01-01T16:13:13.933Z"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/providers/Microsoft.Cache/locations/westus/operationsStatus/testoperationid"), + // StartTime: to.Ptr("2017-01-01T13:13:13.933Z"), + // Status: to.Ptr("Succeeded"), + // }, // } } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/options.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/options.go index 8758e7b00d0c..21cea69ac747 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/options.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/options.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -148,6 +147,28 @@ type DatabasesClientListKeysOptions struct { // placeholder for future optional parameters } +// MigrationClientBeginCancelOptions contains the optional parameters for the MigrationClient.BeginCancel method. +type MigrationClientBeginCancelOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// MigrationClientBeginStartOptions contains the optional parameters for the MigrationClient.BeginStart method. +type MigrationClientBeginStartOptions struct { + // Resumes the long-running operation from the provided token. + ResumeToken string +} + +// MigrationClientGetOptions contains the optional parameters for the MigrationClient.Get method. +type MigrationClientGetOptions struct { + // placeholder for future optional parameters +} + +// MigrationClientListOptions contains the optional parameters for the MigrationClient.NewListPager method. +type MigrationClientListOptions struct { + // placeholder for future optional parameters +} + // OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/polymorphic_helpers.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/polymorphic_helpers.go new file mode 100644 index 000000000000..ebfd290d4277 --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/polymorphic_helpers.go @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. + +package armredisenterprise + +import "encoding/json" + +func unmarshalMigrationPropertiesClassification(rawMsg json.RawMessage) (MigrationPropertiesClassification, error) { + if rawMsg == nil || string(rawMsg) == "null" { + return nil, nil + } + var m map[string]any + if err := json.Unmarshal(rawMsg, &m); err != nil { + return nil, err + } + var b MigrationPropertiesClassification + switch m["sourceType"] { + case string(SourceTypeAzureCacheForRedis): + b = &AzureCacheForRedisMigrationProperties{} + default: + b = &MigrationProperties{} + } + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client.go index 7131e8386ae2..9e594d1efc28 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -25,9 +24,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -43,11 +42,11 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginDelete - Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { @@ -57,8 +56,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ - FinalStateVia: runtime.FinalStateViaLocation, - Tracer: client.internal.Tracer(), + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -71,7 +69,7 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified private endpoint connection associated with the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginDelete" @@ -96,6 +94,10 @@ func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Cont // deleteCreateRequest creates the Delete request. func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -104,10 +106,6 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -117,20 +115,19 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // Get - Gets the specified private endpoint connection associated with the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get // method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { @@ -158,6 +155,10 @@ func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourc // getCreateRequest creates the Get request. func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, _ *PrivateEndpointConnectionsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,16 +171,12 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionName}", url.PathEscape(privateEndpointConnectionName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -196,7 +193,7 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // NewListPager - Lists all the private endpoint connections associated with the Redis Enterprise cluster. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -205,21 +202,20 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName string, clusterName string, options *PrivateEndpointConnectionsClientListOptions) *runtime.Pager[PrivateEndpointConnectionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListResponse]{ More: func(page PrivateEndpointConnectionsClientListResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListResponse) (PrivateEndpointConnectionsClientListResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateEndpointConnectionsClient.NewListPager") - req, err := client.listCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return PrivateEndpointConnectionsClientListResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, clusterName, options) + }, nil) if err != nil { return PrivateEndpointConnectionsClientListResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientListResponse{}, runtime.NewResponseError(resp) - } return client.listHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -229,6 +225,10 @@ func (client *PrivateEndpointConnectionsClient) NewListPager(resourceGroupName s // listCreateRequest creates the List request. func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *PrivateEndpointConnectionsClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -237,16 +237,12 @@ func (client *PrivateEndpointConnectionsClient) listCreateRequest(ctx context.Co return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,11 +260,11 @@ func (client *PrivateEndpointConnectionsClient) listHandleResponse(resp *http.Re // BeginPut - Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens -// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource +// - privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource. // - properties - The private endpoint connection properties. // - options - PrivateEndpointConnectionsClientBeginPutOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginPut // method. @@ -292,7 +288,7 @@ func (client *PrivateEndpointConnectionsClient) BeginPut(ctx context.Context, re // Put - Updates the state of the specified private endpoint connection associated with the Redis Enterprise cluster. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview func (client *PrivateEndpointConnectionsClient) put(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginPutOptions) (*http.Response, error) { var err error const operationName = "PrivateEndpointConnectionsClient.BeginPut" @@ -317,6 +313,10 @@ func (client *PrivateEndpointConnectionsClient) put(ctx context.Context, resourc // putCreateRequest creates the Put request. func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, privateEndpointConnectionName string, properties PrivateEndpointConnection, _ *PrivateEndpointConnectionsClientBeginPutOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateEndpointConnections/{privateEndpointConnectionName}" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -325,10 +325,6 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if privateEndpointConnectionName == "" { return nil, errors.New("parameter privateEndpointConnectionName cannot be empty") } @@ -338,9 +334,10 @@ func (client *PrivateEndpointConnectionsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} + req.Raw().Header["Content-Type"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, properties); err != nil { return nil, err } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client_example_test.go index 392e89386085..d2a302fd15b6 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/privateendpointconnections_client_example_test.go @@ -1,88 +1,51 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionsClient_NewListPager() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseDeletePrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("rg1", "cache1", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateEndpointConnectionListResult = armredisenterprise.PrivateEndpointConnectionListResult{ - // Value: []*armredisenterprise.PrivateEndpointConnection{ - // { - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), - // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }, - // { - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), - // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), - // }, - // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), - // }, - // }}, - // } + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "cache1", "pectest01", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + res, err := poller.PollUntilDone(ctx, nil) + if err != nil { + log.Fatalf("failed to pull the result: %v", err) } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armredisenterprise.PrivateEndpointConnectionsClientDeleteResponse{ + // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseGetPrivateEndpointConnection.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseGetPrivateEndpointConnection.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -93,64 +56,108 @@ func ExamplePrivateEndpointConnectionsClient_Get() { // You could use response here. We use blank identifier for just demo purposes. _ = res // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnection = armredisenterprise.PrivateEndpointConnection{ - // Name: to.Ptr("pectest01"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), - // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ - // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), - // }, - // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ - // Description: to.Ptr("Auto-Approved"), - // ActionsRequired: to.Ptr("None"), - // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // res = armredisenterprise.PrivateEndpointConnectionsClientGetResponse{ + // PrivateEndpointConnection: &armredisenterprise.PrivateEndpointConnection{ + // Name: to.Ptr("pectest01"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), + // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), // }, - // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), // }, // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterprisePutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginPut() { +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseListPrivateEndpointConnections.json +func ExamplePrivateEndpointConnectionsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginPut(ctx, "rg1", "cache1", "pectest01", armredisenterprise.PrivateEndpointConnection{ - Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Auto-Approved"), - Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) + pager := clientFactory.NewPrivateEndpointConnectionsClient().NewListPager("rg1", "cache1", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page = armredisenterprise.PrivateEndpointConnectionsClientListResponse{ + // PrivateEndpointConnectionListResult: armredisenterprise.PrivateEndpointConnectionListResult{ + // Value: []*armredisenterprise.PrivateEndpointConnection{ + // { + // Name: to.Ptr("pectest01"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), + // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // { + // Name: to.Ptr("pectest01"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateEndpointConnections/pectest01"), + // Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ + // PrivateEndpoint: &armredisenterprise.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Network/privateEndpoints/petest01"), + // }, + // PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Auto-Approved"), + // ActionsRequired: to.Ptr("None"), + // Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armredisenterprise.PrivateEndpointConnectionProvisioningStateSucceeded), + // }, + // }, + // }, + // }, + // } } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseDeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { +// Generated from example definition: 2025-08-01-preview/RedisEnterprisePutPrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionsClient_BeginPut() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } - poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginDelete(ctx, "rg1", "cache1", "pectest01", nil) + poller, err := clientFactory.NewPrivateEndpointConnectionsClient().BeginPut(ctx, "rg1", "cache1", "pectest01", armredisenterprise.PrivateEndpointConnection{ + Properties: &armredisenterprise.PrivateEndpointConnectionProperties{ + PrivateLinkServiceConnectionState: &armredisenterprise.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Auto-Approved"), + Status: to.Ptr(armredisenterprise.PrivateEndpointServiceConnectionStatusApproved), + }, + }, + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client.go index df7da58aef42..2a4ee0c047cd 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -25,9 +24,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// - subscriptionID - The ID of the target subscription. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. // - credential - used to authorize requests. Usually a credential from azidentity. -// - options - pass nil to accept the default values. +// - options - Contains optional client configuration. Pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) if err != nil { @@ -42,7 +41,7 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // NewListByClusterPager - Gets the private link resources that need to be created for a Redis Enterprise cluster. // -// Generated from API version 2025-07-01 +// Generated from API version 2025-08-01-preview // - resourceGroupName - The name of the resource group. The name is case insensitive. // - clusterName - The name of the Redis Enterprise cluster. Name must be 1-60 characters long. Allowed characters(A-Z, a-z, // 0-9) and hyphen(-). There can be no leading nor trailing nor consecutive hyphens @@ -51,21 +50,20 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke func (client *PrivateLinkResourcesClient) NewListByClusterPager(resourceGroupName string, clusterName string, options *PrivateLinkResourcesClientListByClusterOptions) *runtime.Pager[PrivateLinkResourcesClientListByClusterResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByClusterResponse]{ More: func(page PrivateLinkResourcesClientListByClusterResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByClusterResponse) (PrivateLinkResourcesClientListByClusterResponse, error) { ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "PrivateLinkResourcesClient.NewListByClusterPager") - req, err := client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) - if err != nil { - return PrivateLinkResourcesClientListByClusterResponse{}, err + nextLink := "" + if page != nil { + nextLink = *page.NextLink } - resp, err := client.internal.Pipeline().Do(req) + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listByClusterCreateRequest(ctx, resourceGroupName, clusterName, options) + }, nil) if err != nil { return PrivateLinkResourcesClientListByClusterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByClusterResponse{}, runtime.NewResponseError(resp) - } return client.listByClusterHandleResponse(resp) }, Tracer: client.internal.Tracer(), @@ -75,6 +73,10 @@ func (client *PrivateLinkResourcesClient) NewListByClusterPager(resourceGroupNam // listByClusterCreateRequest creates the ListByCluster request. func (client *PrivateLinkResourcesClient) listByClusterCreateRequest(ctx context.Context, resourceGroupName string, clusterName string, _ *PrivateLinkResourcesClientListByClusterOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/privateLinkResources" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -83,16 +85,12 @@ func (client *PrivateLinkResourcesClient) listByClusterCreateRequest(ctx context return nil, errors.New("parameter clusterName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{clusterName}", url.PathEscape(clusterName)) - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2025-07-01") + reqQP.Set("api-version", "2025-08-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client_example_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client_example_test.go index 7d8e9c88f5fe..84e264a16279 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client_example_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/privatelinkresources_client_example_test.go @@ -1,27 +1,24 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise_test import ( "context" - "log" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" + "log" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3855ffb4be0cd4d227b130b67d874fa816736c04/specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise/stable/2025-07-01/examples/RedisEnterpriseListPrivateLinkResources.json +// Generated from example definition: 2025-08-01-preview/RedisEnterpriseListPrivateLinkResources.json func ExamplePrivateLinkResourcesClient_NewListByClusterPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) } ctx := context.Background() - clientFactory, err := armredisenterprise.NewClientFactory("", cred, nil) + clientFactory, err := armredisenterprise.NewClientFactory("e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f", cred, nil) if err != nil { log.Fatalf("failed to create client: %v", err) } @@ -36,20 +33,25 @@ func ExamplePrivateLinkResourcesClient_NewListByClusterPager() { _ = v } // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.PrivateLinkResourceListResult = armredisenterprise.PrivateLinkResourceListResult{ - // Value: []*armredisenterprise.PrivateLinkResource{ - // { - // Name: to.Ptr("redisEnterpriseCache"), - // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateLinkResources"), - // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateLinkResources/redisEnterpriseCache"), - // Properties: &armredisenterprise.PrivateLinkResourceProperties{ - // GroupID: to.Ptr("redisEnterpriseCache"), - // RequiredMembers: []*string{ - // to.Ptr("redisEnterpriseCache")}, + // page = armredisenterprise.PrivateLinkResourcesClientListByClusterResponse{ + // PrivateLinkResourceListResult: armredisenterprise.PrivateLinkResourceListResult{ + // Value: []*armredisenterprise.PrivateLinkResource{ + // { + // Name: to.Ptr("redisEnterpriseCache"), + // Type: to.Ptr("Microsoft.Cache/redisEnterprise/privateLinkResources"), + // ID: to.Ptr("/subscriptions/e7b5a9d2-6b6a-4d2f-9143-20d9a10f5b8f/resourceGroups/rg1/providers/Microsoft.Cache/redisEnterprise/cache1/privateLinkResources/redisEnterpriseCache"), + // Properties: &armredisenterprise.PrivateLinkResourceProperties{ + // GroupID: to.Ptr("redisEnterpriseCache"), + // RequiredMembers: []*string{ + // to.Ptr("redisEnterpriseCache"), + // }, // RequiredZoneNames: []*string{ - // to.Ptr("privatelink.redisenterprise.cache.windows.net")}, + // to.Ptr("privatelink.redisenterprise.cache.windows.net"), // }, - // }}, - // } + // }, + // }, + // }, + // }, + // } } } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/redisenterprise_live_test.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/redisenterprise_live_test.go index 11d75fd45c4b..04c03afc1067 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/redisenterprise_live_test.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/redisenterprise_live_test.go @@ -14,7 +14,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" "github.com/Azure/azure-sdk-for-go/sdk/internal/recording" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v3/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v3" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise/v4" "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" "github.com/stretchr/testify/suite" ) diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/responses.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/responses.go index f13532d05110..9cda54b1bdbb 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/responses.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/responses.go @@ -1,7 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// Code generated by Microsoft (R) Go Code Generator. DO NOT EDIT. package armredisenterprise @@ -140,6 +139,29 @@ type DatabasesClientUpgradeDBRedisVersionResponse struct { // placeholder for future response values } +// MigrationClientCancelResponse contains the response from method MigrationClient.BeginCancel. +type MigrationClientCancelResponse struct { + // placeholder for future response values +} + +// MigrationClientGetResponse contains the response from method MigrationClient.Get. +type MigrationClientGetResponse struct { + // Describes the current migration operation on a Redis Enterprise cluster. + Migration +} + +// MigrationClientListResponse contains the response from method MigrationClient.NewListPager. +type MigrationClientListResponse struct { + // The response of a list-all migrations. + MigrationList +} + +// MigrationClientStartResponse contains the response from method MigrationClient.BeginStart. +type MigrationClientStartResponse struct { + // Describes the current migration operation on a Redis Enterprise cluster. + Migration +} + // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { // A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. @@ -165,7 +187,7 @@ type PrivateEndpointConnectionsClientGetResponse struct { // PrivateEndpointConnectionsClientListResponse contains the response from method PrivateEndpointConnectionsClient.NewListPager. type PrivateEndpointConnectionsClientListResponse struct { - // List of private endpoint connection associated with the specified storage account + // The response of a PrivateEndpointConnection list operation. PrivateEndpointConnectionListResult } @@ -177,6 +199,6 @@ type PrivateEndpointConnectionsClientPutResponse struct { // PrivateLinkResourcesClientListByClusterResponse contains the response from method PrivateLinkResourcesClient.NewListByClusterPager. type PrivateLinkResourcesClientListByClusterResponse struct { - // A list of private link resources + // A list of private link resources. PrivateLinkResourceListResult } diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/testdata/_metadata.json b/sdk/resourcemanager/redisenterprise/armredisenterprise/testdata/_metadata.json new file mode 100644 index 000000000000..223c83848329 --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/testdata/_metadata.json @@ -0,0 +1,6 @@ +{ + "apiVersions": { + "Microsoft.Cache": "2025-08-01-preview" + }, + "emitterVersion": "0.10.2" +} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/time_rfc3339.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/time_rfc3339.go deleted file mode 100644 index 81de208d4a50..000000000000 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/time_rfc3339.go +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armredisenterprise - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "regexp" - "strings" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -var tzOffsetRegex = regexp.MustCompile(`(?:Z|z|\+|-)(?:\d+:\d+)*"*$`) - -const ( - utcDateTime = "2006-01-02T15:04:05.999999999" - utcDateTimeJSON = `"` + utcDateTime + `"` - utcDateTimeNoT = "2006-01-02 15:04:05.999999999" - utcDateTimeJSONNoT = `"` + utcDateTimeNoT + `"` - dateTimeNoT = `2006-01-02 15:04:05.999999999Z07:00` - dateTimeJSON = `"` + time.RFC3339Nano + `"` - dateTimeJSONNoT = `"` + dateTimeNoT + `"` -) - -type dateTimeRFC3339 time.Time - -func (t dateTimeRFC3339) MarshalJSON() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalJSON() -} - -func (t dateTimeRFC3339) MarshalText() ([]byte, error) { - tt := time.Time(t) - return tt.MarshalText() -} - -func (t *dateTimeRFC3339) UnmarshalJSON(data []byte) error { - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = dateTimeJSON - } else if tzOffset { - layout = dateTimeJSONNoT - } else if hasT { - layout = utcDateTimeJSON - } else { - layout = utcDateTimeJSONNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) UnmarshalText(data []byte) error { - if len(data) == 0 { - return nil - } - tzOffset := tzOffsetRegex.Match(data) - hasT := strings.Contains(string(data), "T") || strings.Contains(string(data), "t") - var layout string - if tzOffset && hasT { - layout = time.RFC3339Nano - } else if tzOffset { - layout = dateTimeNoT - } else if hasT { - layout = utcDateTime - } else { - layout = utcDateTimeNoT - } - return t.Parse(layout, string(data)) -} - -func (t *dateTimeRFC3339) Parse(layout, value string) error { - p, err := time.Parse(layout, strings.ToUpper(value)) - *t = dateTimeRFC3339(p) - return err -} - -func (t dateTimeRFC3339) String() string { - return time.Time(t).Format(time.RFC3339Nano) -} - -func populateDateTimeRFC3339(m map[string]any, k string, t *time.Time) { - if t == nil { - return - } else if azcore.IsNullValue(t) { - m[k] = nil - return - } else if reflect.ValueOf(t).IsNil() { - return - } - m[k] = (*dateTimeRFC3339)(t) -} - -func unpopulateDateTimeRFC3339(data json.RawMessage, fn string, t **time.Time) error { - if data == nil || string(data) == "null" { - return nil - } - var aux dateTimeRFC3339 - if err := json.Unmarshal(data, &aux); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - *t = (*time.Time)(&aux) - return nil -} diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/tsp-location.yaml b/sdk/resourcemanager/redisenterprise/armredisenterprise/tsp-location.yaml new file mode 100644 index 000000000000..1fbf73e46d5a --- /dev/null +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/redisenterprise/resource-manager/Microsoft.Cache/RedisEnterprise +commit: aa822c9c01b9e83fbc8ad8ec4c308203a3c29287 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/redisenterprise/armredisenterprise/version.go b/sdk/resourcemanager/redisenterprise/armredisenterprise/version.go index 17cd3fffe5ff..d8263ec50504 100644 --- a/sdk/resourcemanager/redisenterprise/armredisenterprise/version.go +++ b/sdk/resourcemanager/redisenterprise/armredisenterprise/version.go @@ -6,5 +6,5 @@ package armredisenterprise const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/redisenterprise/armredisenterprise" - moduleVersion = "v3.0.0" + moduleVersion = "v4.0.0-beta.1" )